2

Let's say I have a line of code:

for i in range(1, 100):

My cursor is on the f in for, and I want to delete the text inside the parenthesis. In other words, I want my line to look like this:

for i in range():

Where my cursor is on the second parenthesis. My initial instinct, after reading this post, was to type di( (see "A text object reference"). However, this does nothing. I also tried dib as suggested by this post (see second answer), but again, nothing happened. What should I do to delete the text between the two parentheses?
Thanks in advance!

  • 3
    This is expected behavior, although it is definitely a little bit unintuitive. Really, the only good solution is f(di(. – DJMcMayhem Jul 5 '16 at 22:07
  • You could use an omap, for example :onoremap n( :<c-u>normal! f(vi(<cr> then dn( will delete the text between the parentheses (and cn( will change the text, and yn( will yank the text, and so on). – grochmal Jul 6 '16 at 0:44

Browse other questions tagged or ask your own question.