3
I'm trying to map some commands to a shortcut in vim. Specifically, I'm trying to get a colorized git diff. If I type this command in Ex mode, it works as expected:
:! git diff --staged % | colordiff | less -R
But if I try to map it in my .vmirc,
map ,gds :! git diff --staged % | colordiff | less -R<CR>
I get the error:
E492: Not an editor command: colordiff | less -R<CR>
I have other mapped commands using a pipe just fine, so it doesn't seem like that should cause a problem. If I call colordiff by its full path, it doesn't help, either. What gives?
3You should take advantage of vimdiff mode as the plugins such as CVSmenu. Otherwise, have you tried
\|
instead ? – Luc Hermitte – 2010-06-21T15:29:13.340D'oh!
\|
did it. I figured it was something stupid. I'll check out CVSmenu, but you should put your comment as an answer, so I can give you credit. :) – Alison R. – 2010-06-21T15:39:04.477