X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/1716b2113066f7cff4c252e3686b5d1766f81f87..b3b577dac59d5d6cf7705884b4d6a19700d987bf:/vim/vimrc diff --git a/vim/vimrc b/vim/vimrc index f57d3d1..f61b74b 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -612,7 +612,18 @@ nmap dd :tab split \| Gdiff \| wincmd h " delete fugitive buffers when closed autocmd BufReadPost fugitive://* set bufhidden=delete -nnoremap gs :Git +function! GitToggle() + if buflisted(bufname('.git/index')) + bdelete .git/index + else + Git + 16wincmd_ + endif +endfunction +command! GitToggle :call GitToggle() +command! GToggle GitToggle +nnoremap gs :GitToggle + nnoremap gd :Gdiffsplit nnoremap gc :echohl WarningMsg \| echo "use \gcc instead" \| echohl None nnoremap gcc :tab G commit -v @@ -629,7 +640,8 @@ nnoremap gb :G blame augroup fugitive_gstatus au! - autocmd BufWinEnter */.git/index resize 16 + autocmd User FugitiveIndex setlocal winfixheight + autocmd User FugitiveIndex nmap = augroup end " Gundo {{{2 @@ -673,6 +685,9 @@ let g:SignatureMap = { " switch let g:switch_mapping = "s" +let g:switch_custom_definitions = [ + \ ['yes', 'no'] + \ ] " spellrotate nmap z] (SpellRotateForward)