Reputation: 9255
For example,
#LINE0
LINE1
LINE2
LINE3
append DEBUG =>
#LINE0
LINE1 DEBUG
LINE2 DEBUG
LINE3 DEBUG
Upvotes: 1
Views: 40
Reputation: 11800
Using global command makes it easier:
:g/./normal A DEBUG
Explanation:
: ................ command
g ................ global
/ ................ start search
. ................ any char
/ ................ end of search
normal ........... do the global command in normal mode
A ................ start appending mode (insert)
<space>DEBUG ..... what you need :)
Upvotes: 0
Reputation: 5851
Use the :global
command:
:%g!/\v^%(\s*\#|$)/ s/$/ DEBUG/
See :help :global
for details.
Upvotes: 2
Reputation: 198324
:%s/\(.\+\)/\1 DEBUG/
In all lines, replace the string of at least one character with that string followed by DEBUG
.
Upvotes: 1