问题描述
我想将NERDTREE切换映射到 Cmd +空格,但是我不知道什么字符代表.vimrc中Mac的命令键.我搜索发现,我们可以使用'D'表示此链接,但无效.顺便说一句,我从终端而不是MacVim使用vim.
I want to map my NERDTREE toggle to Cmd + space but I don't know what character represents Mac's command key in .vimrc. I searched and found that we can use 'D' to represent cmd key from this link, but it doesn't work.BTW I am using vim from the terminal not MacVim.
推荐答案
确实,< D-
映射到键.您可以通过:help< D-
看到它.
It is true that <D-
maps to key. You can see it by :help <D-
.
然而,这在你的 vim
+terminal
中不起作用.它仅适用于 MacVim
.请参见此处
However, this will not work in your vim
+terminal
. It only works in MacVim
. See here
您打算使用的最佳方法是将组合映射为十六进制代码,然后发送到终端.
The best shot for your intention is to map the combination as hex code, sending to terminal.
不过,我不建议您这样做.对于Mac OS环境太重要.例如,任何使用输入法的人都无法将其映射到 + .\
Still I will not recommend doing this. is too important for mac os environment. For example, anyone uses an input method can't map it to +.\
请考虑在此处使用通常的方法:< leader>
.
Please consider using the usual method here: <leader>
.
这篇关于如何在vim中映射mac命令键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!