[英]Vimrc: combine commands with fugitive
I'm trying to combine 我试图结合
:w
:Gcommit -a -m "update"
:Gpush
to a new Command like :W – I've tried 到一个新的命令,如:W –我已经尝试过
:command! W w | Gcommit -a -m "update" | Gpush
But it doesn't work because he treats Gpush as a shell-command instead of a vim-command. 但这是行不通的,因为他将Gpush视为shell命令而不是vim命令。
:command! W w | execute "Gcommit -a -m 'update'" | Gpush
Gcommit
has not been given -bar
argument that would allow it to terminate at the bar (and prohibit it from taking the bar as an argument). 没有为Gcommit
提供-bar
参数,该参数允许它在bar处终止(并禁止将bar作为参数)。 Thus, use execute
to isolate the command, as described in :help :|
因此,如:help :|
所述,使用execute
隔离命令:help :|
. 。 See also :help :command-bar
. 另请参阅:help :command-bar
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.