Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: Increase document traversal speed

Tags:

vim

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.

like image 540
josh-fuggle Avatar asked Nov 03 '11 05:11

josh-fuggle


1 Answers

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

like image 60
user379997 Avatar answered Nov 21 '22 02:11

user379997