r/vim•
TurkeyPi

Has anyone tried turning down their key repeat rate, to learn not to spam hjkl?

Did you see any improvement or was it just annoying?

Posted Feb 14, 2015, 2:45 AM UTC

1322
toupeira•

I turned it up actually, so spamming hjkl would feel more efficient ;-)

14
dddbbbFastFold made vim fast again•

Coincidentally, I just discovered accelerated-jk.

1
613style•

I didn't but I did use vim-hardtime which lets you press hjkl no more than once per second. I actually just uninstalled it a few weeks ago -- I'd forgotten I even had it, which means it worked. That felt good.

12
TurkeyPiOP•

Thanks that's great! exactly what I was looking for.

1
marchelzo•

I would but sometimes when I'm just thinking I like to mash jkjkjkjkjkjkjkjkjkjk and jump back and forth between two lines.

11
IceDane•

I do this as well, because I have au CursorHoldI * stopinsert in my .vimrc, but sometimes I enter insert mode and forgot what I meant to type so I just jump back and forth until I remember what it was.

3
0xJRS•

I'm sorry, whats the use-case for this? Is it to force you to use other keys to move around more efficiently?

Only because I find myself using j/k a LOT sometimes if I need to go up/down a document pretty far but don't know the line number, and I don't think you can do 10j and then . to repeat.

3
Carnitin•

Correct, but you can use CTRL + U to go up half a page, and CTRL + D to go down half a page.

3
0xJRS•

I wasn't aware of that! Thanks

1
tacit7•

There's also C-f (1 page forward) and C-b (1 page back). You can also center your cursor when paging through by

 set scrolloff=999           " center when searching, moving vertically, etc.
1
caotic•

Thats why I love :set rnu Supported on vim 7.3 and up, and on 7.4 nu and rnu are separate settings.

1
Cheezmeisternnoremap <CR> :•

Naw, I just got impatient because hjkl weren't fast enough!

You may also enjoy:

  • {} (as @teradactyl2 has pointed out) for jumping between empty lines
  • fx, tx, Fx and Tx, where x is a character on the same line
  • <C-D> and <C-U> for half-screen jumps
  • <C-E> and <C-Y>, or z- and z<CR>, for moving the "camera" only
  • [[, ]], [] and ][ also do stuff, but I could never figure out quite what
  • I sometimes use 8j or 12k if the above doesn't apply, but YMMV
2
Olreich•

I have <C-HJKL> set to ^, 10j, 10k, and $ respectively, because that made more sense and I only lose two mappings that I don't care about (entering digraphs?!? How is that even a thing?). I'm thinking of making a function for j and k that tries to jump to a blank line between 12 and 15 lines up or down.

1
alx741:wq•

[] ][ etc takes you to the start, end of the next, previous (c like languaje) function, also ]m [m takes you yo next, previous java method

1
pacunar•

At first it's annoying. But I've seen improvements, I've been using more down/up movements like { } instead j/k

2
Grimy_•

I actually turned it way up, and learned to time it precisely. Holding down j for just the right time is actually faster than using digit+j (for me, anyway; with my azerty keyboard, I have to press Shift to use digit keys, making it inconvenient and error prone, e.g. 5J. ).

1
rseymour•

Yep timing my presses is muscle memory whereas counting, etc takes me out of that mode into something just a shade more thoughtful. I'd rather not have to think at all about motion unless I'm automating some edit. That said knowing shortcuts is the key to making them muscle memory.

1
philpirj•

Turned off key repeat more than a year ago, and never coming back.

1
random9878•

I've got these to keep me from forming bad habits:

" Prevent me from doing inefficient stuff
nmap jj :<C-u>echo 'Use nj!'<CR>
nmap kk :<C-u>echo 'Use nk!'<CR>
nmap <Down> :<C-u>echo 'Use nj!'<CR>
nmap <Up> :<C-u>echo 'Use nk!'<CR>
nmap jl :<C-u>echo 'Use /'<CR>
nmap kl :<C-u>echo 'Use /'<CR>
nmap jh :<C-u>echo 'Use /'<CR>
nmap kh :<C-u>echo 'Use /'<CR>

Might seem a bit silly, but after a while I've gotten much better at thinking about moves in combinations. There is a little bit of a delay after digit-hjkl, so I usually think of navigations in a small combination like nkfz or something of that sort.

1
teradactyl2•

noremap J 5j

noremap K 5k

then combine with usage of {} and plain old / search

I've never used plain K and use :join in the rare case I need J

0
evanrelf•

You could keep the functionality of J and K with a leader mapping:

noremap <Leader>J J
noremap <Leader>K K

They will work fine because they are using the original functions due to the noremap part instead of map.

2
-romainl-•

Reading :help navigation should be enough to make you stop using hjkl.

0