我正试着画“Q”呢!到“Q!”在.vimrc?我试过以下几种方法,但不起作用。:Q命令!q!请提供任何缓解这一问题的建议。谢谢。
发布于 2015-05-20 11:50:38
你只要给
:command Q q类似地,您也可以执行其他命令,例如,
:command WQ wq
:command W w发布于 2017-09-12 10:12:54
这对我来说是完美的:
:command-bang Q q<bang>来自vim的帮助(:h command-bang):
Special cases :command-bang :command-bar
:command-register :command-buffer
There are some special cases as well:
-bang The command can take a ! modifier (like :q or :w)和
Replacement text
The replacement text for a user defined command is scanned for special escape
sequences, using <...> notation. Escape sequences are replaced with values
from the entered command line, and all other text is copied unchanged. The
resulting string is executed as an Ex command. [...]
The valid escape sequences are
[...]
<bang> (See the '-bang' attribute) Expands to a ! if the
command was executed with a ! modifier, otherwise
expands to nothing.
[...]发布于 2015-05-20 11:54:25
试一试:
:cmap Q! q!将命令模式下的Q!映射到q!。
https://askubuntu.com/questions/626059
复制相似问题