Currently I have the following maps:

nmap J 5j
nmap K 5k
nmap L 5l
nmap H 5h

This works great if I hit Shift j, it moves down for quick cursor movement. However if I let go of shift while holding j to go back to regular movement speed the cursor stops.

The same is true for if I am moving slowly by holding j then hit shift to accelerate. It just stops. Any work around for this?

I am using git bash in windows.

As much as holding down keys is an anti pattern, some mornings I am not up to thinking harder to use better movements.

  • Using J,K,L,H for h,k,j,l is usually discouraged. You can use other options to scroll the screen. Have you tried options like Ctrl-E?
    – SibiCoder
    Aug 3, 2016 at 13:05
  • Matter of opinion, I am used to this and this makes sense to me. Aug 3, 2016 at 13:06
  • Matter of fact, actually. hjkl are for moving the cursor while <C-u>, <C-d> and friends are for scrolling.
    – romainl
    Aug 3, 2016 at 13:54
  • My mistake I meant cursor movement, not scrolling. Aug 3, 2016 at 13:59

2 Answers 2


Instead of remapping, you should consider the other options for moving the cursor around, i.e.

C-D        Move the cursor Down one page (controlled by the 'scroll' option)
C-U        Move the cursor Up one page (controlled by the 'scroll' option)
M          Move the cursor to the Middle line of the window
H          Move the cursor to the Highest line of the window
L          Move the cursor to the Lowest line of the window

Also, considering you know where you want to go (which is not the case all the time), take advantage of the /, ?, G, % commands:

/pattern   Search for the next pattern    
?pattern   Search for the previous pattern   
NG         Go to line N   (Ngg does the same)
N%         Go to the Nth percentage of the file.

If you are in a structured language, note the following commands that moves the cursor to the start/end of the following/previous function: ]m, ]M, [m, [M.

Doing some C/C++/... ? [#, ]# jumps to conditional macros (#if, #else, ...)

Moving across /* */ comments? [*, ]*, [/, ]/ are your friends.

You can also jump to the next/previous {}() with [{,[(, ]}, ]).

Soo, my point here is that you already have a lot of ways to move around in Vim (there's more than the little list I made). So I would suggest learning those ways before trying to remap core commands as j or k.

  • 1
    Thanks for fixing how I use vim not the problem I was having with vim. (Sounds sarcastic but is serious) Aug 3, 2016 at 20:28
  • My answer was kind of non-answering your question so no offence taken ;)
    – nobe4
    Aug 3, 2016 at 20:29

I would find it enormously frustrating to have the normal functions of H, J and L supplanted; those are "top of screen", "join line", and "bottom of screen" respectively.

I consider that re-mapping J is downright dangerous, because if the mapping fails (or you log into a new machine without your .vimrc), you wind up mangling the file.

As for why the auto-repeat stops when you press or release the shift key, that's a feature of the terminal (emulator), not of vi or vim.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.