I make a shortcut that puts # at the beginning of each line, in the next lines x. x is the type of number i before entering the shortcut, for example, input 11dddeletes the next eleven lines.
Team .,+10 s/^/#/g. Here, the number ten should really be what was printed before the label. How to change the label according to the number that was printed before it?
Added after answering the question:
So now I have the following in .vimrc:
nmap c1 :s/^/#/g<esc>``
nmap c0 :s/^#//g<esc>``
Lets me enter 13ac, add #at the beginning of the next 13 lines and 13dcto delete any #in front of the next 13 lines.
This is better than =podand =cutsince they cause nesting errors.
c1 = add comment,
c0 = delete comment.
# used in Perl.
source
share