5 ms·
TIMTOWTDI: ci{ does the same (I think of "B" as beginning of a Word [including punctuation], so it would confuse me to use the "B" meaning braces)
by bgilroy26 11y ago
TIMTOWTDI: ci{ does the same
(I think of "B" as beginning of a Word [including punctuation], so it would confuse me to use the "B" meaning braces)
- chestervonwinch 11y agonice. I was wondering how one would accomplish the same with parens, i.e. ci(. Why does this work? It doesn't seem to match the usual building of commands. I mean this obviously isn't c command followed by i command followed by paren. Is it just special?
- bgilroy26 11y agoI don't know if I am understanding your question correctly. I read 'ci(' as change what's inside parents. I read 'ci{' as change inside braces. 'ca(' and 'ca{' grab the parents and the braces as well. ========================= These combinations work for (d)elete as well. If your cursor is over the 4th letter of a 6 letter word, 'dw' will delete to the end of the word. 'diw' on the other hand will delete the whole word. (I've never tried 'daw' although I know 'da(' works)
- chestervonwinch 11y agoright. I guess what I meant was 'c' and 'd' are usually followed by movements, so stuff like 'dt)' makes sense to me. 'i' on the other hand is not a movement, so the behavior of 'di)' was surprising to me. It's because 'iw', 'aw', and the like are commands of their own when an operator like 'c' or 'd' precedes [1]. So 'di)' is interpreted as 'd' followed by the 'i)' command (if I'm interpreting it correctly!), not as 'd' followed by 'i' followed by ')', which is nonsense. I hope that was clear - just trying to understand vim better :) [1]: http://vimdoc.sourceforge.net/htmldoc/motion.html#text-objects http://vimdoc.sourceforge.net/htmldoc/motion.html#text-objec...