Mac 中 vim 的功能键替代品?
我想知道您将使用哪些键(或击键)来替换命令映射的功能键。我在 macbook pro 中使用 vim,功能键用于某些系统/桌面/多媒体命令作为第一个选项,而常规功能键是通过 Fn 修饰符访问的。尽管如此,一些 Fn+FX 键已经指定用于其他系统功能,因此请忘记它们。
这是我的映射:
- F1 (默认:vim help)
- F2 -
- F3
:make
- F4
:make run
- F5
:make clean
- F6
:make ctags
(生成标签文件) - F7
:cp
(快速修复:显示之前的错误) - F8
:cn
(快速修复:显示下一个错误) - F9
:NERDTreeToggle
(文件系统浏览器) - F10
:TagbarToggle
(浏览源代码标签) - F11 -
- F12 -
我最缺少的命令是 F9 和 F10。
I would like to know which keys (or keystrokes) would you use to replace the function keys for command mapping. I'm using vim in a macbook pro and the function keys are used for some system/desktop/multimedia commands as the first option while the regular function key is accessed through the Fn modifier. Still, some of the Fn+FX keys are already destined for other system functions so forget about them.
Here comes my mappings:
- F1 (default: vim help)
- F2 -
- F3
:make<CR>
- F4
:make run<CR>
- F5
:make clean<CR>
- F6
:make ctags<CR>
(generates tags file) - F7
:cp<CR>
(quickfix: display previous error) - F8
:cn<CR>
(quickfix: display next error) - F9
:NERDTreeToggle<CR>
(filesystem explorer) - F10
:TagbarToggle<CR>
(browse source code tags) - F11 -
- F12 -
The commands I am missing the most are those of F9 and F10.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Vim 的帮助中有一个关于此的主题。
我通常选择最后一个建议并使用 作为我的映射的前缀,因为我知道它不会与任何默认的键绑定冲突,并且如果我决定不想使用
\
,它可以很容易地更改。Vim's help has a topic about this.
I generally opt for the last suggestion and use <Leader> as the prefix for my mappings since I know it doesn't conflict with any default keybindings and it can easily be changed if I decide I don't want to use
\
.您可以将任何您想要的键(或键序列)映射到
f9
或f10
。将类似的内容放入您的 .vimrc 中:或者也许:
如果您将其映射到也可以在插入模式下使用的内容,我认为您必须为此进行单独的映射:
您可能可以只映射到
;
,但我把它放在很长的地方,因为我没有 F9 映射。You can map any key (or key sequerce) you want to
f9
orf10
. Put something like this in your .vimrc:or maybe:
If you map it to something you can use in insert mode too, I think you have to make a separate mapping for that:
You can probably just map to
<F9>
, but I put it in the long way because I don't have the F9 mapping.