~gpanders/dotfiles

6114fa59c6cadbe615835692a02ebf6d1fb93f24 — Gregory Anders a month ago a98ad14
nvim: make fugitive work for dotfiles

This requires manually setting b:git_dir and modifying the git wrapper
to still set '--git-dir' with '-C $HOME' as an argument.
2 files changed, 3 insertions(+), 1 deletions(-)

M .config/nvim/after/plugin/fugitive.vim
M .local/bin/git
M .config/nvim/after/plugin/fugitive.vim => .config/nvim/after/plugin/fugitive.vim +2 -1
@@ 4,8 4,9 @@ endif

augroup plugin_fugitive
    autocmd!
    autocmd BufReadPost fugitive://* setlocal bufhidden=delete
    autocmd BufRead fugitive://* setlocal bufhidden=delete
    autocmd FileType fugitive,fugitiveblame nmap <silent> <buffer> q gq
    autocmd BufRead * if getcwd() ==# $HOME && (empty('b:git_dir') || b:git_dir ==# '') | let b:git_dir = $HOME . '/.dotfiles' | endif
augroup END

nnoremap g<Space> :Git<Space>

M .local/bin/git => .local/bin/git +1 -0
@@ 4,6 4,7 @@
git=$(which -a git | sed -n "\:$0:!{p;q;}")

case "$*" in
"-C $HOME "* | *" -C $HOME "*) ;;
'-C '* | *' -C '*)
	C=1
	;;