如何映射 Cmd+Ctrl+Option+d 在 MacVim 中切换 NERDTree?
我想模仿 MacVim 的 Textmate 抽屉的行为。 在 Textmate 中,抽屉可以使用 Cmd+Option+Ctrl+d 进行切换,
我希望与 Macvim 相同书呆子树插件。 所以,我尝试了以下方法:
nnoremap <D-C-M-d> :NERDTreeToggle<cr>
但是没有用!
I want to mimic the behavior of Textmate drawer for the MacVim.
In textmate, the drawer can toggle with Cmd+Option+Ctrl+d
I want the same with Macvim with NerdTree plugin.
So, I tried the following:
nnoremap <D-C-M-d> :NERDTreeToggle<cr>
But it did not work!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如 kejadlen 所写,由于 MacVim 的错误/限制,它无法工作。
最酷的事情是它可以防止你做错事:Vim 不是 TextMate,它更智能、更强大,强迫它成为一个简单的 TextMate 替代品将隐藏其真正的力量。
你应该使用
mapleader
,而不是模仿TM的快捷键:mapleader
默认是\
,如果你愿意,你可以使用另一个键,我使用,
:mapleader
很棒,因为它允许您使用整个字母表定义自己的快捷方式,而无需回避系统的默认设置,也不会强迫您用左手演奏疯狂的和弦。As kejadlen wrote, it won't work because of a MacVim bug/limitation.
The cool thing is that it prevents you from doing something wrong: Vim is not TextMate, it's a lot smarter and more powerful and forcing it into being a simple TextMate alternative is going to hide its real power.
Instead of mimicking TM's shortcuts you should use
mapleader
:mapleader
is\
by default, you can use another key if you want, i use,
:mapleader
is great because it allows you to define your own shortcuts using the whole alphabet without dodging your system's default and without forcing you to do crazy chords with your left hand.stackoverflow.com/questions/4982246/vim-multiple-meta-keys 的重复。简短的回答 - 显然是 MacVim 中的一个错误? (code.google.com/p/macvim/issues/detail?id =317)
Dupe of stackoverflow.com/questions/4982246/vim-multiple-meta-keys. Short answer - apparently a bug in MacVim? (code.google.com/p/macvim/issues/detail?id=317)
我不能肯定地说,因为我不使用 MacVim,但你尝试过吗:
据我所知,你必须设置此选项才能使用苹果键。
I can't say for sure because I don't use MacVim but have you tried:
As far as I know you have to set this option to use the apple key.