我可以(重新)映射 vim 中的 Ex 命令吗? [英] Can I (re)map Ex commands in vim?

查看:26
本文介绍了我可以(重新)映射 vim 中的 Ex 命令吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢 vim 和它给我的速度.但有时,我的手指太快了,我发现自己在输入 :WQ 而不是 :wq.(在德语键盘上,您必须按 Shift 才能获得冒号 :.)然后 Vim 会抱怨 WQNot一个编辑器命令.

I love vim and the speed it gives me. But sometimes, my fingers are too speedy and I find myself typing :WQ instead of :wq. (On a German keyboard, you have to press Shift to get the colon :.) Vim will then complain that WQ is Not an editor command.

有什么方法可以制作 WQ 编辑器命令吗?

Is there some way to make W and Q editor commands?

推荐答案

尝试

 :command WQ wq
 :command Wq wq
 :command W w
 :command Q q

这样您就可以定义自己的命令.参见 :help command 了解更多信息.

This way you can define your own commands. See :help command for more information.

这篇关于我可以(重新)映射 vim 中的 Ex 命令吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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