8

Is there a way to change inside of a comment with Vim? I know you can change inside brackets and quotes with i] and i". For example, If you are on a quote you can press,

ci"my new textESC

And this will replace the text inside of the quote with the phrase "my new text", but how can I do the same thing with C comments which are enclosed with /* and */?

Braiam
  • 35,380
  • 25
  • 108
  • 167
Tyler Durden
  • 5,411
  • 16
  • 57
  • 96

1 Answers1

5

The Vim term for text that can be selected, yanked, deleted, and modified based on certain groupings of characters is text object (see :help text-objects). There's a comment-aware text object plugin called textobj-comment.

echristopherson
  • 1,072
  • 8
  • 14