Let's say I have the following in my buffer: foo &bar. The following command does not work as expected: :%S/foo &bar/bar &foo/. I'd expect the contents of the buffer to be bar &foo after running the command, but the contents are bar foo &barfoo.
Changing the command to :%S/foo &bar/bar \&foo/ (notice the slash before the &) makes it work as expected.
Let's say I have the following in my buffer:
foo &bar
. The following command does not work as expected::%S/foo &bar/bar &foo/
. I'd expect the contents of the buffer to bebar &foo
after running the command, but the contents arebar foo &barfoo
.Changing the command to
:%S/foo &bar/bar \&foo/
(notice the slash before the&
) makes it work as expected.OS: Mac OS X 10.9 My vimrc is here: https://github.com/Valloric/dotfiles/blob/master/vim/vimrc.vim My vim --version output: