In Vim, I continue to find that I want keystrokes to rewrite the rest of the parameter list. For example, in the following Python function:
def myfun(a, b=12, c=(1,2,3), d=15): pass
I want to replace c=(1,2,3), d=15 with e=12 . The ci( key ci( allows me to replace everything inside the entire parameter list, but I found that I often want to keep some prefix of the Vim text object. In general, I would suggest that this keystroke that I am looking for would be useful in the context of replacing the final parameters function calls as well as definitions.
The desired answer to this question will apply to quoted strings, [] and other text objects. Please note that I understand everything about text objects, as indicated in " How to choose between brackets (or quotation marks or ...) in Vim? ".
Both @ pb2q and @romainl give good search shortcuts, but they require me to visually find the end of the closing block in order to develop a search that is unambiguous in terms of any other garbage that is in the block (for example, I think the nested calls function). In particular, I often find myself in this when I have a nested bracket inside the set of brackets that I want to manipulate. The answer I really want is similar to ci) or ca) , which is completely conceptually based on the nearest spanning bracketing ) and works elegantly with other nested blocks ) .
source share