Because your .vimrc
file came from a Windows machine, it has \r\n
line endings, so you need to get rid of the \r
(which shows up as ^M
). It looks like my Mac doesn't have dos2unix
, so you'll probably want to just use tr
:
tr -d '\r' <~/.vimrc >tmp
mv tmp ~/.vimrc
Or from within vim itself:
:%s/\r//g
On the off-chance you have \r
s you actually want to keep,
:%s/\r$
With the implied //