Re:Vim users: stop using hjkl
by falcolas on Friday March 01, 2013 @11:39AM
(#5305239)
No advice on moving from line to line? Word and character movements are great (and well worth learning), but how do you suggest moving to just the next line without spamming `w`?
[ Parent
| on HN ]
For moving directly vertical:
:nnoremap k gk
:nnoremap j gj
These move up/down one character, even if it is the same line wrapped over. Really beneficial for things like LaTeX editing.
Re:Vim users: stop using hjkl
by imissmyjuno on Friday March 01, 2013 @12:04PM
(#5305430)
I was going to say. Disabling hjkl makes moving between word wrapped lines impossible
If you want to go to the same cursor position on the next line, definitely j is the way to go.
Much of the time, I want to go to a specific part of the next line. In which case, let's say I want to go to the parse function, I'll do "/par<enter>".
+
and - to move 1 line up. Combine with a number, 4+ to move down 4 lines, complementing 4G or :4<CR> to move to 4th line.
I don't see those as an improvement (i.e. worth committing to muscle memory) for `j` and `k` that would incentivize me to no-op those two keys. You can do `4j` as well.
I use {} for moving paragraphs at a time. And HML for switching to top, middle or bottom of screen.
using '/' (search) comes to mind. Drew also did an episode cover some more ideas and touches on relative number moving. http://vimcasts.org/episodes/long-range-line-duplication/