Replace to end of text-object
vim
Solution
There are a bunch of commands starting with ] that go to the end of some kind of structure, and respect nesting. ]) to go to the end of a parenthesized block, ]} to go to the end of a braced block, ]/ to go to the end of a C comment (`/*...*/` style). Use [ in place of ] to go to the beginning instead of the end.
So to do the replacement of your `c=(1,2,3), d=15` type c]).
The complete list of these commands is listed under `:help various-motions`. Unfortunately there isn't one for blocks delimited by brackets, because [[ and ]] already had a different meaning in classical vi, and vim has defined ][ and [] to fit nicely with those.
Problem
In Vim, I keep finding myself desiring a keystroke to rewrite the rest of some parameter list. For example, in the following Python function: ``` def myfun(a, b=12, c=(1,2,3), d=15): pass ``` I wish to replace the `c=(1,2,3), d=15` with `e=12`. The keystroke `ci(` allows me to replace everything inside the entire parameter list, but I find that I often want to retain some prefix of the Vim text-object. In general, I'd assume this keystroke I'm searching for would be useful in the context of replacing final parameters of function calls as well as definitions. A desirable answer to this question would apply to quoted strings, `[]` blocks and other text objects too. Note that I understand all about text-objects as answered in "How to select between brackets (or quotes or ...) in Vim?". Both @pb2q and @romainl give good search shortcuts, but they require me to visually find the end of the enclosing block to devise a search which is unambiguous in terms of any other garbage which is in the block (e.g. think nested function calls). In particular, I often find myself wanting this when I have nested parenthesis inside the parenthesis set I want to manipulate. The answer I really want is analogous to `ci)` or `ca)` which is entirely conceptually based on the nearest enclosing bracketing `)` and deals entirely gracefully with other nested `)` blocks.