On 20/10/08 00:32, [EMAIL PROTECTED] wrote:
> Hi Everybody!
>
> I would like to print, say, a certain part of a program. But not the
> whole program. Guess, I could select the part of interest via visual
> mode. Questions: Is there an alternative (perhaps better) way to
> select the part? How to proceed, after the part is selected?
>
> Regards,
> Walter
Assuming your selection is linewise, just type
:hardcopy
in Visual mode. The appropriate range '<,'> (meaning "from first to last
lines of the latest Visual area) will be automagically inserted.
You can use any range you like, for instance:
- from the current line to end-of-file
:.,$hardcopy
- lines 135 to 484 (inclusive):
:135,484hardcopy
- from 3 lines above to 4 lines below the current line
:.-3,.+4hardcopy
- 10 lines starting at the current line
10:hardcopy
which Vim automagically translates to
:.,.+9hardcopy
- From the current line to the first line below it that consists only of
the Vim "endf[unction]" command, possibly with spaces and/or tabs around it:
:.,/^\s*endf\%[unction]\s*$/hardcopy
- etc.
Some of the above may be unavailable in Vim builds compiled with a
restricted featureset.
Best regards,
Tony.
--
I cannot conceive that anybody will require multiplications at the rate
of 40,000 or even 4,000 per hour ...
-- F. H. Wales (1936)
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---