Skip to content

Instantly share code, notes, and snippets.

@mipmip
Last active October 5, 2016 10:19
Show Gist options
  • Save mipmip/44488aa8f7255f13b871c5dd4ce02ac2 to your computer and use it in GitHub Desktop.
Save mipmip/44488aa8f7255f13b871c5dd4ce02ac2 to your computer and use it in GitHub Desktop.
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>)
@mipmip
Copy link
Author

mipmip commented Oct 5, 2016

For me an enormous timesaver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment