Editting

Remove text after cursor and do the same on each line

  • C : delete text after cursor on current line

  • type substitute text

  • move cursor to next line

  • . : repeat substitution operation on the new line

Remove carriage-return character ^M

A text file created in Windows has a carriage return character followed by a newline character at the end of each line. The carriage return character can show up as ^M in Vim in Unix-like systems.

To remove all of them automatically, do

:s/^M//

To insert ^M, type Ctrl-V Ctrl-M.

Note

References

Related pages

External links

blog comments powered by Disqus