The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 13: | Line 13: | ||
When working with Python and other languages which do not use braces, it is useful to be able to jump to and from lines which have the same indentation as the line you are currently on. The following mappings in your [[vimrc]] will help: |
When working with Python and other languages which do not use braces, it is useful to be able to jump to and from lines which have the same indentation as the line you are currently on. The following mappings in your [[vimrc]] will help: |
||
<pre> |
<pre> |
||
β | nnoremap <M-,> :call search('^'. matchstr(getline('.'), '\( |
+ | nnoremap <M-,> k:call search('^'. matchstr(getline(line('.')+1), '\(\s*\)') .'\S', 'b')<CR>^ |
β | nnoremap <M-.> :call search('^'. matchstr(getline('.'), '\( |
+ | nnoremap <M-.> :call search('^'. matchstr(getline(line('.')), '\(\s*\)') .'\S')<CR>^ |
</pre> |
</pre> |
||
β | With these mappings, in normal mode, press <code> |
+ | With these mappings, in normal mode, press Alt-<code><</code> to find the previous line with the same indent as the current line, or press Alt-<code>></code> to find the next such line. These mappings should work in gvim, but you may need to choose different keys if working with Vim in a terminal. |
---- |
---- |