As long as we're off topic onto the subject of vim, .vimrc and comments in the left hand column -- let me add that I've found it very useful to put some macros into my .vimrc to allow me to quickly comment out a line or block of code (or to remove such comments).
The following commands for .vimrc provide the macros ",ic" and ",rc" to insert and remove comments. In normal mode, it only affects the current line. More useful may be visual mode, where you can select a large chunk of code and comment it out in one shot.
vmap ,ic :s/^/#/g<CR>:let @/ = ""<CR> map ,ic :s/^/#/g<CR>:let @/ = ""<CR> vmap ,rc :s/^#//g<CR>:let @/ = ""<CR> map ,rc :s/^#//g<CR>:let @/ = ""<CR>
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In reply to Re^2: Slightly Off Topic: vim/perl comment behavior
by xdg
in thread Slightly Off Topic: vim/perl comment behavior
by saberworks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |