I sometimes find document traversal to be too slow in Vim when using h, j, k, l.
Is there a way to temporally increase the number of lines / characters that these keys move the cursor? (I.e. instead of moving 1j, pressing j will move 3j)
Edit:
Solution:
:map <F8> :noremap j 3j <CR>
:map <S-F8> :noremap j j <CR>
I wanted something like this so that I can easily browse longer bodies of code that am not necessarily familiar it. This approach allows me to easily toggle between “browsing” mode and “coding” mode.
While possible (use
:noremap j 3jEnter and:noremap j jEnter to restore), it may not be useful for very long to change the behaviour of these keys.There are many ways to navigate in Vim. Of course you can advance by full screens using CtrlF and CtrlB.
You can, as you alluded to, enter a number of moves before executing the navigation.
You can also go directly to a specific line using :9Enter, for example.
If you see the text to which you want to navigate, use / or ? followed by the text.
For h and l, you can navigate word boundaries more quickly with b, w, and e, and contiguous non-whitespace with B, W, and E.