Sunday, April 30, 2006

VIM note: switch dos format to unix format

Still the same problem as my last Python note, now I want to do it with vim.

This could be done by global pattern replacement. The command is:
:%s/pattern/replacement

The pattern needs to use literal mode: [Ctrl-v] key
In this case it's [Ctrl-v][CR], showed as ^M. The whole command will look like :%s/^M$//.

No comments: