Take the 2-minute tour ×

Update: It turns out to be a bug in MacVim (or perhaps a feature that has yet to be implemented).

I am trying Vim, coming from TextMate. TextMate has a Ruby plugin where you can type Control+Command+Shift+E, and it will find all the lines in your file that contain "# => ", and it will update them with the inspected result of that line.

I have found the library they use to do this, it's called xmpfilter, and comes with rcodetools.

So I can get Vim to do the same behaviour by typing "mzggVG:!xmpfilter -a" which will highlight the whole file, go to last line mode, and pass the contents to xmpfilter, and then replace the highlighted contents with the result.

But I want to map it to the same key combination that TextMate uses, so that it has the same interface, because this has become a huge piece of my workflow.

Here are a bunch of examples of how I have tried to make this work

:nmap <silent> <D-C-E> mzggVG!xmpfilter -a<cr>'z
:nmap <silent> <S-D-C-e> mzggVG!xmpfilter -a<cr>'z
:nmap <silent> <SDC-e> mzggVG!xmpfilter -a<cr>'z
:nmap <silent> <S-<D-<C-e>>> mzggVG!xmpfilter -a<cr>'z
:nmap <silent> <S-><D-><C-e> mzggVG!xmpfilter -a<cr>'z

But none of those work correctly. It would seem that I can't figure out how to specify multiple meta keys. (As a sanity test, I have verified that :nmap <silent> <S-e> mzggVG!xmpfilter -a<cr>'z does work.) Any help would be appreciated.

(Note: I'm using MacVim on Snow Leopard)

share|improve this question
I asked a similar question, and the answer I was given worked fine in my case. I was expecting that your first attempt <D-C-E> would work, but it doesn't. The link that GWW provided seems to confirm that there is no way to create the mapping that you want to, which is a shame! –  nelstrom Feb 13 '11 at 14:33
add comment

1 Answer

If I'm not mistaken the command key is represented by D not M (M is alt I believe). I think you'd want to use <S-D-C-e>. ** Note: AS far as I know the command key only works when you are using the GUI.

share|improve this answer
Yes, this does seem to be true. I can do, for example, <D-e> to do it. Or, I can do command+shift+e with <D-E>, but can't seem to get the control in there. I'll update the question to reflect this. –  Joshua Cheek Feb 13 '11 at 3:49
Based on this vim.1045645.n5.nabble.com/… It appears using ctrl is case insensitive. Perhaps you could use Alt (M) instead of Ctrl (C)? –  GWW Feb 13 '11 at 3:51
add comment

Your Answer


