4 ms·
di" is one of my favorite commands. Delete everything inside the quotes not including the quotes. You usually want to replace what's inside the quotes, so henc
by ehsanu1 14y ago
di" is one of my favorite commands. Delete everything inside the quotes not including the quotes.
You usually want to replace what's inside the quotes, so hence use ci"
cit is pretty nice for replacing a tag's inner html. And of course this works with parentheses - ci( - and brackets - ci[ - and curly braces and single quotes and angle brackets.. I love vim :)
- weaksauce 14y agoYeah you are right; I use c more than d. The a command is also very useful.
- orthecreedence 14y agoWow cit...I've been wondering if this exists for a year now. I remember reading about it when I first started learning vim but it somehow eluded me afterwards. Thanks! I use ci{ all the time for functions and CSS. It's like magic. Whenever I'm using something like nano, I'll instinctively type what looks like a long string of gibberish: "jjjddo [oh crap] <bs><bs>..." Once you really start getting used to the language, it makes it frustrating to use anything else.
- weaksauce 14y ago> Once you really start getting used to the language, it makes it frustrating to use anything else. Indeed... That is why I have been contributing to Xvim[1] for Xcode it's so nice to have vim bindings in Xcode. [1] https://github.com/JugglerShu/XVim https://github.com/JugglerShu/XVim
- lloeki 14y ago> Wow cit...I've been wondering if this exists for a year now Then marvel at vim-surround: cs"', cs)(, or cst<foo>, or (Shift-)v select visually S <mytag>, and argtextobj: cia and daa. Those are the two plugins that I really miss on a stock vim. [0] https://github.com/tpope/vim-surround.git https://github.com/tpope/vim-surround.git [1] https://github.com/vim-scripts/argtextobj.vim https://github.com/vim-scripts/argtextobj.vim