X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/1716b2113066f7cff4c252e3686b5d1766f81f87..4d3e068bbf1d35ba4bea61aee336b23b715afc12:/vim/vimrc diff --git a/vim/vimrc b/vim/vimrc index f57d3d1..8c75c58 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1,8 +1,3 @@ -" My vimrc. -" -" Author: Samir Benmendil -" - " runtimepath {{{1 set runtimepath ^=$XDG_CONFIG_HOME/vim set runtimepath +=$XDG_CONFIG_HOME/vim/after @@ -612,7 +607,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 +635,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 +680,9 @@ let g:SignatureMap = { " switch let g:switch_mapping = "s" +let g:switch_custom_definitions = [ + \ ['yes', 'no'] + \ ] " spellrotate nmap z] (SpellRotateForward)