> i am a Emacs fans and new to vim. is there a decent way in vim for commenting a
> region of code (C/C++, Java, Pytho, Bash) and allowing uncomment them later?
When setting a filetype, you cannot rely on a certain variable being
set, containing the proper comment markup, as it is done in emacs. There
are two options &comments and &commentstring but these are not supported
by all filetypes (syntax or ftplugins) equally well. (Well, this is a
plea to use these options, especially &commentstring, in more
ftplugins.) AFAIK there is no builtin function/command specialized on this.
That said, there are plenty of plugins that do the job as well as emacs
does. And being the first to reply, I'd like to use the opportunity to
... well: this one is mine: tComment
. It tries to make
use of these two builtin options, ie. it can also deal with &comments.
Others which are probably more sophisticated in one respect or the other
can be found here:
Alternatively, you could also use vi commands for adding a prefix to a line.