VIM: Perform two actions at once
I often save :w and commit to SVN svn commit -m "Ticket 351" as two operations. Is there a way to combine them into a single operation so that I might just :⇑Enter when the need arises? I don't want to map a key as I will sometimes have to change the commit message.
Use | as a command separator (see :help :bar):
:w|!svn commit -m foo
You could also write a function. E.g. something like;
function! Commit(msg) write let response = system('svn commit -m "' . a:msg . '"') echo response endfunction
:call Commit('ticket 1234')
@JoshLee gives the literal answer. However, why is a keybinding unacceptable to you?
nnoremap <Leader>s :w<bar>!svn commit -m<space>
will still let you write your commit message before you push Enter...