// blog / note

note

vim trick: ci" is criminally underrated

Change everything inside the next pair of quotes. Small thing, big quality of life.

The vim text-object that changed how I edit:

ci"     " change inside quotes — replaces what's between the next pair of "..."
ci'     " same for '...'
ci(     " change inside (...)
ci[     " change inside [...]
ci{     " change inside {...}
cit     " change inside HTML tag

Combine with da (delete around — including the delimiters) and you’ve got most of what surrounds-edit plugins try to add. Pure vim, no config needed.

← back to all posts