In
vim:
- Press ESC
- Then V (shift-v)
- Move cursor up or down to select wanted lines
- Then press : and type s/^/# /
- And finally, press Enter
If you create a visual mapping like
vmap # :s/^/# /<CR>, you have an instant shortcut to comment highlighted lines out. Now, highlight wanted lines, press the
# character (
shift-3), and voila, those lines are commented out. I'm sure there's a better way.
You mentioned about IDE, right? Well, vim is my Perl IDE.
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!