Re:Ask HN: I'm done with the IDE. What's a good alternative?
by vilya on Sunday October 03, 2010 @12:30PM
(#1752993)
You 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.
Re:Ask HN: I'm done with the IDE. What's a good alternative?
by eel on Sunday October 03, 2010 @12:27PM
(#1752983)
You 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.
Re:Ask HN: I'm done with the IDE. What's a good alternative?
by tdfx on Sunday October 03, 2010 @03:13PM
(#1753372)
I 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).
Re:Ask HN: I'm done with the IDE. What's a good alternative?
by randallsquared on Sunday October 03, 2010 @12:32PM
(#1753000)
gm 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%20ref... ]
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?