diff --git a/vim/plugin/settings/vim-fugitive.vim b/vim/plugin/settings/vim-fugitive.vim new file mode 100644 index 0000000..b4ff5a0 --- /dev/null +++ b/vim/plugin/settings/vim-fugitive.vim @@ -0,0 +1,15 @@ +" 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 .. :edit %:h | + \ 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 +