Hi!
I want to comment out lines in some code I have. I have different kinds of codes, and they use different comment leaders. E.g. in latex: '%', in Fortran 90: '!' and in python: '#'. I want to do a substitute command that looks something like this:
:g/<search-string>/s/^/<add-comment-leader-here>/
If this is possible, I could also make a command in Vim that automatically commented out the selected text. Something like this:
vmap <z> :'<,'>s/^/<add-comment-leader-here>/
Any ideas are welcome! :)