0

When the arrow keys are used in Vim, the cursor scrolls at my current rate (defaults write NSGlobalDomain KeyRepeat -int 0 (very fast)), but when using 'h', 'j', 'k' or 'l', scrolling doesn't occur. Any suggestions?

m_antis
  • 79
  • 1
  • 8
  • Related: http://stackoverflow.com/questions/7406814/in-vim-how-do-you-scroll-a-buffer-so-the-cursor-location-is-centered-in-the-scr/7406927 – nrz Aug 31 '14 at 20:17

2 Answers2

0

First, hjkl don't scroll, they move the cursor which may provoke scrolling. If you want to scroll, use actual scroll commands:

" scroll by one line
<C-e>
<C-y>

" scroll by half screen
<C-u>
<C-d>

" scroll by full screen
<C-b>
<C-f>

See :help scrolling.

Second, did you try other values? Maybe there's a threshold beyond which Vim stops responding?

romainl
  • 186,200
  • 21
  • 280
  • 313
0

To clarify, your arrow keys are simply moving the cursor (which may induce scrolling) at an extremely fast rate. This is done by your system (by your configuration) not by Vim.

I ran into this issue myself, when I wanted an easier way to scroll code without having to constantly press jk. Here's a couple of solutions I found:

  1. Using <C-f> and <C-b>, which scroll the screen up one page or down one page. More similiar commands can be found here

  2. Try out vim easy motion, which makes motion as a whole in vim easier

  3. Finally, try typing in the command:

    defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
    

    By default, mac allows a fancy feature when pressing a key, options are induced (such as accents and the like). It might be possible that vim is being tricked by that feature.

Community
  • 1
  • 1
Paul Bae
  • 60
  • 1
  • 6