Comment

Comment by thezorg

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());
             ^
parent thezorg 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton