regexvimreplace

Adding characters at the start and end of each line in a file


What is the best way to add some characters at the start and end of each line? Can it be done using Vim, or some other way?


Solution

  • In vim, you can do

    :%s/^\(.*\)$/"\1"/