我经常将:w
SVN 保存并提交svn commit -m "Ticket 351"
为两个操作。有没有办法将它们组合成一个操作,这样我就可以:⇑</kbd>Enter when the need arises? I don't want to map a key as I will sometimes have to change the commit message.
谢谢。
我经常将:w
SVN 保存并提交svn commit -m "Ticket 351"
为两个操作。有没有办法将它们组合成一个操作,这样我就可以:⇑</kbd>Enter when the need arises? I don't want to map a key as I will sometimes have to change the commit message.
谢谢。
|
用作命令分隔符(请参阅):help :bar
:
:w|!svn commit -m foo
你也可以写一个函数。例如类似的东西;
function! Commit(msg)
write
let response = system('svn commit -m "' . a:msg . '"')
echo response
endfunction
然后后来:
:call Commit('ticket 1234')
@JoshLee 给出了字面上的答案。但是,为什么您不能接受键绑定?
nnoremap <Leader>s :w<bar>!svn commit -m<space>
仍然会让你在按下 Enter 之前写下你的提交信息......