是否可以在Vim中重新映射Ex命令(将:Ack映射到:ack)? [英] Is it possible to remap an Ex command in Vim (remap :Ack to :ack)?
本文介绍了是否可以在Vim中重新映射Ex命令(将:Ack映射到:ack)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Vim插件 ack.vim ,但是我不明白为什么命令是:Ack
,大写字母"A"(有点讨厌按住 shift ).
I use the Vim plugin ack.vim, but I don't understand why the command is :Ack
with a capital "A" (a little annoying to hold shift).
是否可以将其重新映射到:ack
?
Is it possible to remap this to :ack
?
推荐答案
内置命令以小写字母开头,自定义命令以大写字母开头.这些是规则. Vim根本不允许您定义以小写字母开头的自定义命令.
Built-in commands start with a lowercase character and custom commands start with an uppercase character. Those are the rules. Vim simply won't let you define a custom command starting with a lowercase.
如果您不喜欢它,则不会阻止您创建普通模式映射:
If you don't like it, nothing prevents you from creating a normal mode mapping:
nnoremap <leader>a :Ack<Space>
,甚至比:ack<Space>
快.
这篇关于是否可以在Vim中重新映射Ex命令(将:Ack映射到:ack)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文