Comment by BrouteMinou
1 day ago
I always find it funny when people say to not repeat h-l, w-W keys for horizontal movement.
No way I am starting to count how many characters there are in front of my cursor just to have the satisfaction of typing "31-l"...
I am totally going to spam some 2w 3w llll until I reach the desired position.
I think it's more about getting used to f-F,t-T,A,I, and <semicolon> which can be quicker especially with code. You can also add easymotion or similar plugins for the powered version of those.
I used to be a big fan of easymotion until I discovered that / is also a motion and that with inline search enabled you can use CTRL-G to cycle through results.
Example: d / foo, first foo will be highlighted, use CTRL-G to select the next one if not correct (repeat if necessary; CTRL-T cycles backwards), ENTER to delete until highlighted section.
Unfortunately CTRL-G is not implemented in IdeaVIM.
Some nice explanations of f and t:
https://stackoverflow.com/questions/12495442/what-do-the-f-a...
TIL! `f` looks really useful, thanks.
That's the point of this plugin - holding "wwwwwwww..." is a bad habit, because it's very likely there is an objectively better way of getting there. Not necessarily "142l" but "/<piece of word><ENTER>" or "f,;;".
At first I had to count characters. Over time, it becomes intuitive. In the same way that if someone holds up three fingers you don't count "one, two, three", you immediately perceive that they are holding up three fingers.
For numbers under 10, I usually hit the right amount. For numbers around 30, I might be off by one to five, but move on from then. When I want to remove similar prefixes from multiple non-consecutive lines, I might use things like 31x, go to the next instance (maybe continuing a search with n), and press period.
Honestly though, if you're moving forward 31 characters, there's often an easier approach, like 4w (move forward three Words). Again, at first I had to consciously think about which combination to use. Over time it becomes second nature.
I still use jjjj sometimes. It's imperfect, but at least it's the human that's the limiting factor, and not the software.
A big help for me is H/M/L - mnemonic high/middle/low.
Moves to the top/bottom/middle of the viewport, and the. I'll jjjj/kkkk away! (or probably just search, mostly).
Agree. vim-sneak is the answer to this, you can reach anywhere with maximum 3 key presses. It's very intuitive and easy to pick up. If I had to pick only one Vim plugin it would be sneak.
https://github.com/justinmk/vim-sneak
I quite like leap.nvim:
https://github.com/ggandor/leap.nvim
That seems reasonable, I will definitely test that out.
Thank you.
`set relativenumber` to see where you’re jumping
There was a guide that mentioned "scrabble tile" movement. `fj` is quicker than `fe` because J is way less common than E.
Once you get "near", then zeroing in on your target (eg: `fj`, `Fa` for "adjacent") can be the fastest/most accurate way to get to where you want to go.
I always use f-F, t-T to move within lines, have found that to be the quickest.
>No way I am starting to count how many characters there are
You don't have to. There are many ways to do a jump without counting. Some of the require plugins like flash.nvim, some do require pressing `;` multiple times
Relative line numbers can help with j and k.
Do you even `%` to navigate to matching ()[]{}? Often useful to jump straight to function end from signature, lispy paran-nests, and so on.
llllllllllllllllllllllllllllllllllllllllllllllllllll