Last active
June 3, 2022 09:31
-
-
Save irizwaririz/ac38272bdd2859e28f8032535dc07f3e to your computer and use it in GitHub Desktop.
Toggle the vim-fugitive git status window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Easily open/close (toggle) the git status window. | |
nnoremap <leader>gs :call ToggleGStatus()<CR> | |
function! ToggleGStatus() | |
if buflisted(bufname('.git/index')) | |
bd .git/index | |
else | |
G | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment