Vim Tips Wiki
Register
(Change to TipImported template + severe manual clean)
(Move categories to tip template)
Line 9: Line 9:
 
|version=5.7
 
|version=5.7
 
|rating=38/16
 
|rating=38/16
  +
|category1=
  +
|category2=
 
}}
 
}}
 
Using 'gj' and 'gk' instead of just 'j' and 'k' allows moving down and up by screen lines instead of file lines. Here are a few nifty mappings for that:
 
Using 'gj' and 'gk' instead of just 'j' and 'k' allows moving down and up by screen lines instead of file lines. Here are a few nifty mappings for that:

Revision as of 04:57, 25 April 2008

Tip 919 Printable Monobook Previous Next

created April 28, 2005 · complexity basic · author Raj Kiran Grandhi · version 5.7


Using 'gj' and 'gk' instead of just 'j' and 'k' allows moving down and up by screen lines instead of file lines. Here are a few nifty mappings for that:

:noremap <Up> gk
:noremap! <Up> <C-O>gk
:noremap <Down> gj
:noremap! <Down> <C-O>gj
" the following are optional, to move by file lines using Alt-arrows
:noremap! <M-Up> <Up>
:noremap! <M-Down> <Down>
:noremap <M-Up> k
:noremap <M-Down> j

Comments

See: