7 ms·
I believe many VIM users overestimate the importance of using h,j,k,l in comparison to numeric modifiers. Holding down j to scroll down the page is no more "rig
by RegEx 14y ago
I believe many VIM users overestimate the importance of using h,j,k,l in comparison to numeric modifiers. Holding down j to scroll down the page is no more "right" than holding down the down arrow, in my opinion.
The following made me considerably faster:
* Relative Line numbering (For Vim 7.3). G/gg stop being convenient for frequent line movement once your file goes beyond 100 lines. Doing math in your head to figure out if line 589 is 16 lines from 605 takes way too much effort. Append this[0] to your ~/.vimrc, and then CTRL-l will toggle relative/absolute line numbering. So in relative mode, you see a line is 20 up from your cursor, and 20k takes you there with no guessing or holding down keys.
[0]: https://gist.github.com/3418841 https://gist.github.com/3418841
* Learn the following: f,F,t,T. Combine them with c and d.
* zz => make current line appear in middle of the screen.
* H,L,M
* w,W,b,B. Combine with numeric modifiers (5dW)
* CTRL-u, CTRL-d, CTRL-f, CTRL-b
* % for block highlighting. Works well with curly braces by default, you may need to pick up extra plugins for ruby/python.
* g; will cycle back to the last places you were in insert mode. g, will cycle forward.
- ibotty 14y agozz is nice. but i hardly need it with set scrolloff=5 with which i always have 5 lines context below and above the cursor.
- RegEx 14y agoI had tried scrolloff=1000 for middle scrolling. I liked it for a while, but got a little tired of the jumpy-ness. I'll give 5 a go.
- johncoltrane 14y agoSame experience here. I have set it to 4 since one year: it's perfect.
- amadeus 14y agoEven better, just learn to use EasyMotion, it's one of the most efficient ways of navigating around a file: https://github.com/Lokaltog/vim-easymotion https://github.com/Lokaltog/vim-easymotion
- johncoltrane 14y agoI've tried it and didn't like it at all. The main problem is how it replaces the letter I'm searching with another unrelated one, making all the matches practically unreadable. To me, at least. set incsearch and /foo ?bar are more than enough for my needs.
- dedward 14y agoEasyMotion is really only good for getting to something you are staring right at on the screen.... I want to go THERE.. not meant as a general search or anything like that... and doesn't help get off the screen, for sure.
- amadeus 14y agoBasically what dedward said before me. EasyMotion is not for searching, it's for moving the cursor deliberately to a place onscreen where you need to make an edit.
- johncoltrane 14y agoYes, I know. Searching is how I move to where I want. It's a lot less confusing to me than EasyMotion's logic, it's consistent whether the word I want to jump to is visible or not and it's a native feature. Well, I was curious when it was released so I've used it for a couple of weeks and found it horrible and confusing. Obviously many people like it so let's say it's a matter of taste.
- ninetax 14y agoI have been playing with the relative numbering all afternoon. I love having all my lines indexed, but it's hard to hit any number above 5 or 6 with my right hand because it's about to hit j or k. I wish it could be indexed with a combination of numbers between 1 and 5 only, but I guess that would mess with the j and k functionality. Any ideas? Also note: I am not a touch typist.
- RegEx 14y agoI don't use anything beyond 5(with the exception of 0 because that's fairly easy for me to hit). 6 and 7 are the hardest to hit. 17k for me just becomes 15kkk, for example. If you ever find yourself needing to go 50+ up or down, you should be using one of H, L, or M to take out a good chunk of that.
- ninetax 14y agoYeah that's what I was thinking. Thanks!