dotar/vim/settings/vim-fugitive.vim

15 lines
673 B
VimL
Raw Normal View History

2017-08-02 00:15:51 +08:00
" The tree buffer makes it easy to drill down through the directories of your
" git repository, but its not obvious how you could go up a level to the
" parent directory. Heres a mapping of .. to the above command, but
" only for buffers containing a git blob or tree
autocmd User fugitive
2019-04-10 18:52:11 +08:00
\ get(b:, 'fugitive_type', '') =~# '^\%(tree\|blob\)$' |
2017-08-02 00:15:51 +08:00
\ nnoremap <buffer> .. :edit %:h<CR> |
\ endif
" Every time you open a git object using fugitive it creates a new buffer.
" This means that your buffer listing can quickly become swamped with
" fugitive buffers. This prevents this from becomming an issue:
autocmd BufReadPost fugitive://* set bufhidden=delete