Vim Essential Plugin: tComment
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Read Time:
1 min
This post is part of a series called Vim Essential Plugins.
The tComment Vim plugin serves one purpose: to help you toggle comments in your code as quickly as possible. I'll show you how easy it is to use in this quick tip.
Usage
This utility plugin is a cinch to use - mostly because it performs only a single task. To comment a line of code, press ctrl _ ctrl _
. Alternatively, if you wish to toggle multiple lines, select them in visual mode, and, again, press the trigger sequence: ctrl _ ctrl _
You can also use the shortcut gcc
to comment a single line at a time. If you'd instead prefer to comment a single word, a few letters, or any other motion, use gc{motion}
. For example, to comment the first word on a line, I could type: gcw
, or, for the first three words: gc3w
.
Advertisement
Want a weekly email summary?
Subscribe below and we’ll send you a weekly email summary of all new Code tutorials. Never miss out on learning about the next big thing.
Sign upHi, I'm Jeffrey. I'm the creator of Laracasts and spend most of my days building the site and thinking of new ways to teach confusing concepts.
Advertisement
Advertisement
Advertisement
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.