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 it’s not obvious how you could go up a level to the
|
|
|
|
|
" parent directory. Here’s a mapping of .. to the above command, but
|
|
|
|
|
" only for buffers containing a git blob or tree
|
|
|
|
|
autocmd User fugitive
|
|
|
|
|
\ if fugitive#buffer().type() =~# '^\%(tree\|blob\)$' |
|
|
|
|
|
\ 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
|
|
|
|
|
|
2011-12-13 10:21:42 +08:00
|
|
|
|
" fugitive.git
|
|
|
|
|
" ========================================
|
|
|
|
|
" For fugitive.git, dp means :diffput. Define dg to mean :diffget
|
2012-01-23 10:50:01 +08:00
|
|
|
|
nnoremap <silent> ,dg :diffget<CR>
|
|
|
|
|
nnoremap <silent> ,dp :diffput<CR>
|