4 ms·
It looks like the 'i(' motion has special meaning in Vim - it corresponds to the previous unmatched '(' to the next matched ')'. Type 'help motion.txt' and loo
by cdavoren 15y ago
It looks like the 'i(' motion has special meaning in Vim - it corresponds to the previous unmatched '(' to the next matched ')'. Type 'help motion.txt' and look for i(.
Edit: Actually, the description for i" implies that its behaviour should be the same. Which one works correctly, I wonder?
- thristian 15y agoSince brackets come in matchable pairs and double quotes do not, and because brackets can be nested while double quotes cannot, it wouldn't surprise me if this were a deliberate difference. If the user hits "di(" on a line and there's no "(" before the cursor, you can search backwards over previous lines looking for an unmatched "(" without too much worry you'll get confused by a stray "(" and delete something the user didn't expect. If the user hits 'di"' on a line and there's no '"' before the cursor, searching any further is quite likely to hit a false positive and do something ridiculous (like deleting all the code between two string literals).
- cdavoren 15y agoThat's a fair interpretation. I'd be more comfortable if this difference were reflected in the documentation - it could at least state that if no previous quote is found, the next quote on the line will be used.