I want to search lines beginning with certain string in Vim, and then add something at the end of file. I have tried the following but it removed everything instead of appending
:%s/^12138/*something_at_end_of_file/g
This search all lines which begin with 12138
but it removes everything and add something_at_end_of_file
But I want to preserve actually string and add at end of line.
^12138
or at the end of the file?