On 10/11/08 15:55, [EMAIL PROTECTED] wrote:
> Hi Everybody,
>
> two weeks ago I had asked how to print, say, a certain part of a
> program. Tony gave the answer. Thanks! I have two related questions:
>
> How to determine, at which line in, say, a program I'am?
[...]
Since ":hardcopy" is an ex-command, you can use the dot as part of its
|[range]| to mean the current line. For instance:
" print only the three lines centerd on the current line:
:.-1,.+1ha
" print 10 lines starting at the current line:
:.,.+9ha
" which can be abbreviated (when typing by hand) to
10:ha
" print from the current line to the end of the file
:.,$ha
" print to the start of the file to (and including)
" the current line
:1,.ha
If you just want to know the current line number there are three methods:
:set number
displays line numbers in the left margin.
:echo line('.')
answers with the current line number.
Finally, in most cases the current line, byte-in-line and virtual-column
are displayed near the right end of the current status line. For instance:
304,0-1
means you are at line 304, which is an empty line.
305,1-8
means you're on the first byte of line 305, which is a hard tab.
1,14-12
means you're at virtual column 12 of the first line, with some multibyte
characters before it making it the 14th byte on the line.
306,48
means you're in column 48 of line 306, and either all characters before
it on the same line are single-byte, or hard tabs and multibyte
characters compensate each other to make it also the 48th byte.
Best regards,
Tony.
--
Q: How many supply-siders does it take to change a light bulb?
A: None. The darkness will cause the light bulb to change by itself.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---