Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The v is redundant unless you want highlighting. You can do yi" directly (or ci" or di").

For more fun, activate vim-surround. E.g. to replace surrounding quotes with parentheses: cs"(



I habitually use visual mode for a lot of stuff like that so quick flash shows me what was affected (in case of typo). If the highlighted part isn't what I expected I instantly know to undo, rather than having to think about the resulting text for a moment.


Same. Which shows a weakness of vim, I think it’d be much more usable if it had the verb last: iw would select the word then you can delete, yank, or even extend the selection knowing exactly what you’re going to operate on.

I think kakoune works like that, but I don’t have the will to learn another editor and vi is what’s available everywhere anyway


The problem with Kakoune-like object-action order is that you need more modifier keys.


vi"p or vi"P is a great way to overwrite "" contents with the contents of your unnamed register


it's fun, I have had vim-surround installed for years but keep forgetting how that it exists.


surround and sneak are my desert island vim plugins




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: