4

私はしばしば SVN への保存:wとコミットをsvn commit -m "Ticket 351"2 つの操作として行います。それらを単一の操作に結合する方法はありますか:⇑</kbd>Enter when the need arises? I don't want to map a key as I will sometimes have to change the commit message.

ありがとう。

4

3 に答える 3

6

|コマンド セパレータとして使用します( を参照:help :bar)。

:w|!svn commit -m foo
于 2012-04-09T15:37:29.313 に答える
2

関数を書くこともできます。たとえば、次のようなものです。

function! Commit(msg)

    write

    let response = system('svn commit -m "' . a:msg . '"')

    echo response

endfunction

じゃあ後で:

:call Commit('ticket 1234')
于 2012-04-09T15:47:12.900 に答える
1

@JoshLeeは文字通りの答えを出します。しかし、キーバインドが受け入れられないのはなぜですか?

nnoremap <Leader>s :w<bar>!svn commit -m<space>

Enter を押す前にコミットメッセージを書くことができます...

于 2012-04-09T15:49:51.017 に答える