Comment & Uncomment multiple lines in Vim
Baba Gyani Triviani said: " When someone said 'No Comments' I just had to intervene. No comments? Have multi-line comments my friend! " Commenting and uncommenting multiple lines in Vim can be a little tricky. Here is a small snippet of code to show how you can do this. I have done this for just a few of languages. But you can extend this to any number as per your choice. Save the following into a file and call it vcomments.vim Once this is done, open your ~/.vimrc file if it exists, or create a new one. There, put the following code. :source ~/ vcomments.vim :map <C-a> :call Comment() <Enter> :map <C-b> :call Uncomment() <Enter> Where you can replace a and b of and by whatever is convenient to you. This just calls the functions when the Ctrl + <key> combination is hit. To use it, just select the lines to comment by using Shift + v and moving cursor up or down to select lines. Then, hit the Ct...