February 22nd, 2012, 09:44 AM #1
vim remap question
I have a question for the vi and vim masters out there. I am trying to map a key in vim to execute a search-and-replace command (for ## comments).
The following command works perfectly if I just type it in:
:s'<,'>g/^/norm I ##
However, if I map it over to a key like this, in my .vimrc:
map + :s'<,'>g/^/norm I ## <CR>
I get this error when I hit '+':
E492: Not an editor command: '<,'>'<,'>g/^/norm I ## <CR>
Any ideas why it is changing the command?
Thanks in advance!