Vim多个元键 [英] Vim multiple meta keys
问题描述
更新:原来是 MacVim中的一个错误(或者一个尚未实现的功能)。
Update: It turns out to be a bug in MacVim (or perhaps a feature that has yet to be implemented).
我正在尝试Vim,来自 TextMate 。 TextMate有一个Ruby插件,您可以在其中键入 Control + 命令 + Shift + E ,它会找到所有您的文件中包含#=>的行,它将使用该行的检查结果进行更新。
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.
我找到了他们使用的库这就是所谓的xmpfilter,并附带 rcodetools 。
I have found the library they use to do this, it's called xmpfilter, and comes with rcodetools.
所以我可以通过键入mzggVG:!xmpfilter -a来使Vim做同样的行为,这将突出显示整个文件,转到最后一行模式,并将内容传递给xmpfilter,然后将突出显示的内容替换为结果。
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.
但是我想将其映射到与TextMate使用的相同的组合,以便它具有相同的界面,因为这已经成为一个巨大的
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
:nmap <silent> <S-><D-><C-e> mzggVG!xmpfilter -a<cr>'z
但是没有一个正常工作。看来,我不清楚如何指定多个元键。 (作为一个理智测试,我已经验证了:nmap< silent>< S-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)
推荐答案
如果我没有错误,则命令键由D表示不是M(M是我相信的alt)。我想你想使用< S-D-C-e>
。 **注意:据我所知,命令键仅在使用GUI时有效。
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.
这篇关于Vim多个元键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!