|
|
|
|
|
by thezorg
1095 days ago
|
|
I recently learned about the `])` motion (and similarly, `]}`), and it's probably my absolute favorite. I used to rely on e.g. `df)` to delete function parameters. The problem is that 1. it doesn't work when the function call spans multiple lines, and 2. it doesn't work if there's a nested function call. With `d])`, Vim will delete until the next unmatched ')', regardless of which line it's on! And to think this motion is buried under "Various motions": https://vimhelp.org/motion.txt.html#%5D%29. Edit: an example: // This will become my_func(foo);
my_func(foo, MakeBar(), MakeBaz());
^
|
|
One day I used the key binding and then realized a few minutes that I hadn't installed the script on that computer yet. After some searching in :help I realized that I'd not only reimplemented a feature that already exists in vim, but I mapped it to the exact same keys.