Vim: Increase document traversal speed
Answered by Jay is sufficient, I would like to add the following !
There are many different kinds of navigation possible in vim, ( where as the h, j, k, l are just line navigation ). Some more are:
- screen navigation
- spl navigation
- search navigation
- word navigation
Refer this write up to find out the short cut keys to do it: Essential Vim editor navigation
What @Bryan Ross have suggested is absolutely right. I want to add just a thing. Use relativenumber, it will help you to use j
and k
more efficiently.
Try Ctrl+D/Ctrl+U and Ctrl+F/B (Up/Down, Forward/Back respectively).
These will traverse the document much faster than h,j,k,l
.
While possible (use :noremap j 3j
Enter and :noremap j j
Enter 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.