I tried the code unsuccessfully
:%s/\n/*\n/g
I tried the code unsuccessfully
:%s/\n/*\n/g
:%s/$/\*/g
should work. So should :%s/$/*/g
as MrWiggles points out correctly.
%s/\s*$/*/g
this will do the trick, and ensure leading spaces are ignored.
:%s/\n/*\r/g
Your first one is correct anywhere else, but Vim has to have different newline handling for some reason.
Note there is no need for the trailing 'g' as only one replacement is possible.
Even shorter than the :search command:
:%norm A*
This is what it means:
% = for every line
norm = type the following commands
A* = append '*' to the end of current line