Skip to content

Substituting from this line to the end of the file (in Vim)

In vim, if you want to change something from the current line until the end of the line, you can use .,$ as the range segment of the s command.

   :.,$s/COMPILE/COMPILE BODY/g

Substituting over the full file is done by using the % range, which is a shortcut for 1,$, ie from the first to the last line.

   :%s/COMPILE/COMPILE BODY/g

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*