Tip #103: Move to next/previous line with same indentation
tip karma |
Rating 90/32, Viewed by 3821
|
Read and edit this tip on the
Vim tip wiki.
The wiki may have a more recent version of this tip.
created: |
|
August 22, 2001 6:06 |
|
complexity: |
|
intermediate |
author: |
|
Paul Wright |
|
as of Vim: |
|
6.0 |
When working with Python and other languages which don't use braces, it's useful to be able to jump to and from lines which have the same indentation as the line you are currently on.
nn <M-,> k:call search ("^". matchstr (getline (line (".")+ 1), '\(\s*\)') ."\\S", 'b')<CR>^
nn <M-.> :call search ("^". matchstr (getline (line (".")), '\(\s*\)') ."\\S")<CR>^
will map Alt-< and Alt-> in Normal mode to upward and downward searching for lines with the same indent as the current line.
<< smart mapping for tab completion |
using vim to complement Perl's DBI::Shell >>
Additional Notes
|