3 ms·
One of the beautiful things about vim is that they have multiple ways to skin the cat and, as such, you develop your own mode of using it. For example to navig
by scop 3y ago
One of the beautiful things about vim is that they have multiple ways to skin the cat and, as such, you develop your own mode of using it.
For example to navigate within a single line you can:
- f[character] (jump to character)
- w/e (jump word by word)
- A (jump to end, navigate from there)
- / (search!)
- h/l (move left/right)
- even more ways!
What’s funny is that, theoretically, some of these movements are more “efficient”, for example jumping to a specific character is a lot faster than going character by character. However, I found that I often go character by character or searching instead of f[] just because my brain finds it easier to move that way than to think “what character is that”. I use massive jumps when finding a line; but once on that line, I use very slow movements. Now, it’s totally less efficient, but it’s how my brain/fingers navigate most naturally even after repeated attempts at to train myself to use “better” methods. Perhaps my habits will change over time, but regardless it is remarkable how “personal” vim can be.
Thank you Bram!
(Edited to fix list format)
- ansible 3y agoI would advise anyone who wants to master VIM (and NeoVIM) to get used to all the different ways to move through a document. Here's a good wallpaper about that: https://www.rosipov.com/blog/vim-movement-cheatsheet/ https://www.rosipov.com/blog/vim-movement-cheatsheet/ Ever now, after decades of use, I try to incorporate the most efficient methods of moving around the document and around the screen. Sometimes, when I've just held down movement keys (such as 'hjkl') to get to a specific location, I'll go back to where I was and, for example, use the find character command instead as practice.
- kagevf 3y agoNeat! I didn't know # was "backwards" *
- zeroimpl 3y agoOddly I often navigate in a line by typing “f “ (f space) then press . repeatedly until I’ve gotten to the right place. Never occurred to me to navigate within a line using / but that ought to be faster most of the time
- williamdclt 3y agoI just mash w, that’s one key instead of 3 (f .)!