Skip to content

Instantly share code, notes, and snippets.

@itspriddle
Created February 10, 2012 20:33
Show Gist options
  • Save itspriddle/1792596 to your computer and use it in GitHub Desktop.
Save itspriddle/1792596 to your computer and use it in GitHub Desktop.
Launch GitX from Vim
" drop in ~/.vim/plugins or add to ~/.vimrc
" Requires https://github.com/tpope/vim-fugitive
function! s:GitX(...)
silent exe '!gitx --git-dir='.b:git_dir.' '.join(a:000)
redraw!
endfunction
augroup gitx
autocmd!
" :Gitx - Open GitX
autocmd User Fugitive command! -buffer -nargs=* Gitx call s:GitX(<q-args>)
" :Gstage - Opens GitX on stage view
autocmd User Fugitive command! -buffer Gstage call s:GitX('-c')
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment