Saturday, November 2, 2013

Re: jump to true beginning of line

On 2013-11-02 18:41, Chris Lott wrote:
> When editing code that is indented can I jump to the true beginning
> of a specific line (say line 10) in one shot? I know 10gg and :10
> but both of those take me to the first non-whitespace character of
> the line rather than the 0th character.

Not that I know of out of the box, but if you're okay with typing 2
characters anyway ("gg"), you can use 10G0 which does a "10G" to go
to the given line, then "0" to go the to first (your "0th") column.
This could be mapped something like

:nnoremap G G0

Despite its description in the help, 'nostartofline' doesn't seem to
respect being in the first column if your jump lands you on a line
with leading whitespace. I tested this with 'nosol' set ad line 19
containing leading indentation before characters. Going to the first
column of a previous line and issuing "19G" landed me on the first
character on line 19 after the indent, not the first column as I
would have expected.

-tim



--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: