3 ms·
I'm guessing you mean "dd" and "yy" to delete/yank lines. "x" deletes a single character, what you mean extract a line? If you learn "w", which just means adva
by joslin01 8y ago
I'm guessing you mean "dd" and "yy" to delete/yank lines. "x" deletes a single character, what you mean extract a line?
If you learn "w", which just means advance by a word, you can combine them with your existing knowledge for much better use. So "dw" becomes delete a word, or "d3w" means delete next 3 words. "v" is also useful in conjunction with "w" / "b".
- caseymarquis 8y ago'[d|c]iw', to delete/change the word your inside of is another small improvement.
- _frog 8y agoI'm also a big fan of `ci[(|'|"]` to change all the text between a pair of delimiters. I can type `ci"` while my cursor's at the start of the line, and it'll jump to the first set of double quotes, remove the text that's currently between them, and enter edit mode.
- the_white_oak 8y agoYou can also use `cib` to change text between braces and `ciB` to change text between curly braces.
- LyndsySimon 8y agoIsn't this part of vim-surround? http://github.com/tpope/vim-surround http://github.com/tpope/vim-surround
- mercer 8y agoI'm fairly sure that works out of the box. I get annoyed when another editor's VIM mode doesn't properly emulate it.
- bArray 8y agoI would either: * SHIFT+V to highlight a line, `d` to delete * `:d` to delete the current line Not experimented with `dd` (or `yy`).
- cyphar 8y agoSHIFT+V + 'd' is a longer way of doing 'dd'. SHIFT+V + 'y' is a longer way of doing 'yy'. You can also delete and yank multiple lines by using 'd2d' (delete two lines) or similar. You can also delete lines upwards by using a movement command like 'dk' (or 'd2k' if you want to delete the two lines above).
- bArray 8y agoI quite like the visual confirmation that I'm not about to do something stupid, to me that's worth paying the cost of an extra key. And I jump between enough systems that I doubt myself with stuff like: is `d1d` or `d0d` or `dd` equal?