In various editors one can mark a block of code and with a shortcut, comment it right away. Is there a possible way to do it in Vim without an extra plugin? If not, which plugin or script would you suggest?
Asked
Active
Viewed 2,228 times
2 Answers
2
The best way that I found is using tpope's vim-commentary plugin. You're able to use the ctrl+v I# mentioned in the question linked to in the comment to the OP, but this will automatically work with different comment types with different languages.
Cody Poll
- 723
- 4
- 8
0
From my answer over here:
I use scrooloose/nerdcommenter for this.
With this plugin you can visual select your lines and hit leader+c to toggle comments. Depending on the file type it will use different symbols for commenting.