mipmip
10/5/2016 - 10:17 AM

functions for fast single file vim/fugitive workflow

functions for fast single file vim/fugitive workflow

" Functions for fast single file vim/fugitive workflow
"
" Add this in your .vimrc and use it like this:
"   Just commit current file with message
"   :GitCommitWithMessage 'fix typo'

"   Commit current file with message and push afterwards
"   :GitCommitPushWithMessage 'fix typo'


function! s:GitCommitWithMessage(message)
  execute ":Gwrite"
  execute ":Gcommit -m ". a:message
endfu

command! -nargs=1 GitCommitWithMessage call s:GitCommitWithMessage(<f-args>)

function! s:GitCommitPushWithMessage(message)
  execute ":Gwrite"
  execute ":Gcommit -m ". a:message
  execute ":Gpush"
endfu

command! -nargs=1 GitCommitPushWithMessage call s:GitCommitPushWithMessage(<f-args>)