nvim: after: git/fugitive: Add settings and mappings to not leave buffers behind

This commit is contained in:
Sanchayan Maity 2021-05-14 14:20:31 +05:30
parent a9c91c06e4
commit 08df60f731
2 changed files with 8 additions and 0 deletions

View file

@ -1,6 +1,8 @@
" Disable whitespace highlighting in git buffer " Disable whitespace highlighting in git buffer
autocmd! BufEnter <buffer> DisableWhitespace autocmd! BufEnter <buffer> DisableWhitespace
nmap <buffer> <silent>q :bwipeout!<CR>
nmap <buffer> <Leader>gb :call git#git_branch_checkout()<CR> nmap <buffer> <Leader>gb :call git#git_branch_checkout()<CR>
nmap <buffer> <Leader>gB :call git#git_branch_delete()<CR> nmap <buffer> <Leader>gB :call git#git_branch_delete()<CR>
nmap <buffer> <Leader>gd :call git#git_diffview_commit()<CR> nmap <buffer> <Leader>gd :call git#git_diffview_commit()<CR>

View file

@ -21,3 +21,9 @@ nnoremap <Leader>g+ :Git stash pop<CR>:e<CR>
nnoremap <Leader>gs :Git<CR> nnoremap <Leader>gs :Git<CR>
nnoremap <Leader>gS :Git<SPACE> nnoremap <Leader>gS :Git<SPACE>
nnoremap <Leader>gw :Gwrite<CR> nnoremap <Leader>gw :Gwrite<CR>
augroup custom_fugitive
autocmd!
autocmd FileType fugitive nnoremap <buffer><silent> q :bwipeout!<CR>
autocmd BufReadPost fugitive:// setlocal bufhidden=delete
augroup END