如何将inoremap/nnoremap设置为“命令键"?在Vim上? [英] How to set inoremap/nnoremap to "command key" on Vim?

查看:266
本文介绍了如何将inoremap/nnoremap设置为“命令键"?在Vim上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将操作分配给Vim中的命令键. 没有方法吗?

I would like to assign operation to a command key in Vim. Aren't any methods?

推荐答案

假设您使用的是Mac,您不能在vim中映射命令键,只能在MacVim中映射.

Supposing you are on a Mac, you can't map the command key in vim, only in MacVim.

如果使用的是MacVim,则映射应使用<D-…>,如nnoremap <D-l> <C-w>l所示.但这不是一个好主意,原因有很多,其中包括我的另一个答案中列出的原因.

If you are using MacVim, your mappings should use <D-…> as in nnoremap <D-l> <C-w>l. But it's not a very good idea for many reasons among them those listed in this other answer of mine.

代替nnoremap <leader>l <C-w>l,使用<leader>.

请参见:help leader:help key-notation.

这篇关于如何将inoremap/nnoremap设置为“命令键"?在Vim上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆