Meino Christian Cramer wrote:
As a vim newbie I would do that using block oriented visual mode on
the first line and I-nserting a '%' (TeX's comment sign), which
results in:
% bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
% foo bar gnu gnats
% bla blabla foo bar gnu gnats
%
% bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
% foo bar gnu gnats
%
% bla blabla foo bar gnu gnats
So far so nice...it works.
But would be there a way to acchieve the following commenting:
% bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
% foo bar gnu gnats
% bla blabla foo bar gnu gnats
% bla blabla foo bar gnu gnats bla blabla foo bar gnu gnats bla blabla
% foo bar gnu gnats
% bla blabla foo bar gnu gnats
(blank lines not commented out) by a similiar simple command like
CTRL-v SHIFT-i <text><ESC> ?
As said: This Q is mostly curiosity - based...I even dont know,
whether haveing such a feature would be really useful or not.
As another solution, you could use the EnhancedCommentify plugin.
Visual select,
trigger the commentify-it map, and the lines are commentified. Works
for several
languages, including LaTeX. It also doesn't commentify the blank lines
as you've
requested.
EnhancedCommentify:
http://vim.sourceforge.net/scripts/script.php?script_id=23
Regards,
Chip Campbell