So i came up with a simple macro which will do it two concurrent keystrokes.
Add this to you .vimrc file
map \\ I#
map \] ^x
With this in your rc file, you can comment line by pressing "\" and "\".
To un-comment, press "\" and "]". I found these key combinations best suited for me. But you can change the second keystroke according to your needs.
Saves time for me, hope helps others.
Note: Verified with Gnu Vim.
2 comments:
Good start Punit. :-)
Ya, Good Start Punit. I have added your blog as a link from mine.
As far as this post is concerned, there are many more macros that you can add to your vimrc file.
I remember adding macros like "for (i=0;;i++)", "while(i)" and others. Turned out to be useful initially but then I did not use the VIM editor frequently :(
Post a Comment