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
Did you see any improvement or was it just annoying?
Posted Feb 14, 2015, 2:45 AM UTC
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.
Thanks that's great! exactly what I was looking for.
I would but sometimes when I'm just thinking I like to mash jkjkjkjkjkjkjkjkjkjk and jump back and forth between two lines.
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.
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.
Correct, but you can use CTRL + U to go up half a page, and CTRL + D to go down half a page.
I wasn't aware of that! Thanks
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.
Thats why I love :set rnu Supported on vim 7.3 and up, and on 7.4 nu and rnu are separate settings.
Naw, I just got impatient because hjkl weren't fast enough!
You may also enjoy:
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.
[] ][ 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
At first it's annoying. But I've seen improvements, I've been using more down/up movements like { } instead j/k
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. ).
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.
Turned off key repeat more than a year ago, and never coming back.
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.
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
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.
Reading :help navigation should be enough to make you stop using hjkl.
I turned it up actually, so spamming hjkl would feel more efficient ;-)
Coincidentally, I just discovered accelerated-jk.