3 ms·
I'm curious. I've been using vim for not that long (but long enough that it's now my main editor). What all shortcuts exist for getting to the middle of a line
by younata 16y ago
I'm curious.
I've been using vim for not that long (but long enough that it's now my main editor). What all shortcuts exist for getting to the middle of a line?
- eel 16y agoYou can use 40| to go to the 40th column of a line. I typically use e or b to jump by words to reach the middle of a line. You can also 5e to jump by 5 words for instance too. I would be curious to know if there are other shortcuts for doing this too though.
- vilya 16y agoYou can use repeat counts with the cursor movement commands. For example, 40h will move your cursor 40 characters to the right; or 5w will move it forward 5 words. Alternatively you can use the search commands, '/' (forward search) or '?' (backwards search) with the text at the middle of the line as your search string.
- randallsquared 16y agogm jumps to the middle of the screen in the current line. [Edit: here's a nice cheatsheet of them: http://www.digilife.be/quickreferences/qrc/vim%20quick%20reference%20card.pdf http://www.digilife.be/quickreferences/qrc/vim%20quick%20ref... ]
- tdfx 16y agoI find myself using fX (find character X) often, where X is a character at the position I want to start editing. When I'm editing string parameters of a function I'm calling, I use di' / di" a lot (moves to first ' / ", deletes inside content, and drops to insert mode).