开发者

Vim multiple meta keys

开发者 https://www.devze.com 2023-02-10 17:32 出处:网络
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+Comman

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> <SDC-e> mzggVG!xmpfilter -a<cr>'z
开发者_Go百科: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)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号