Update: It turns out an error in MacVim (or, perhaps, a feature that has not yet been implemented).
I am trying Vim based on TextMate . TextMate has a Ruby plugin where you can type Control+ Command+ Shift+ Eand it will find all the lines in your file containing "# =>" and it will update them using the verified result of this line.
I found the library that they use for this, it is called xmpfilter and comes with rcodetools .
So, I can get Vim to do the same behavior by typing "mzggVG :! xmpfilter -a", which selects the entire file, switches to the last line mode and transfers the contents to xmpfilter, and then replaces the selected contents with the result.
But I want to map it to the same keyboard shortcut that TextMate uses, so that it has the same interface, because it has become a huge part of my workflow.
Here are some examples of how I 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> <SDC-e> mzggVG!xmpfilter -a<cr>'z
:nmap <silent> <S-><D-><C-e> mzggVG!xmpfilter -a<cr>'z
But none of them work correctly. It would seem that I canβt understand how to specify several meta keys . (As a performance test, I confirmed that it :nmap <silent> <S-e> mzggVG!xmpfilter -a<cr>'zworks.) Any help would be appreciated.
(Note: I am using MacVim on Snow Leopard)