8209ca7da1
Instead of requiring each version control plugin to modify airline to show the current branch, provide a customization function we can check instead. Following the example of airline_theme_patch_func, you define the variable like so: let g:airline#extensions#branch#custom_head = 'david#svn#get_branch' Custom functions should cache their value. They may need an autocmd to invalidate their cache: " Use a buffer-unique group name to prevent clearing autocmds for other " buffers. exec 'augroup svndavid-'. bufnr("%") au! autocmd BufWinLeave <buffer> unlet! b:svndavid_branch augroup END This change lets me integrate with vc.vim (I couldn't get VCSCommand working for svn) or write my own thing for perforce. Additionally, always load whole file and check for existence. Instead of determining up front whether various scm plugins are installed, check for them on use so they can be added after this script is sourced. This also mitigates the problem of checking for existence of autoload functions (which are not loaded by exist()). Since we're checking root-level functions, they're likely to be loaded once we're using any part of the plugin. |
||
---|---|---|
.. | ||
tabline | ||
wordcount/formatters | ||
ale.vim | ||
branch.vim | ||
bufferline.vim | ||
capslock.vim | ||
commandt.vim | ||
csv.vim | ||
ctrlp.vim | ||
ctrlspace.vim | ||
cursormode.vim | ||
default.vim | ||
denite.vim | ||
eclim.vim | ||
example.vim | ||
fugitiveline.vim | ||
hunks.vim | ||
keymap.vim | ||
neomake.vim | ||
netrw.vim | ||
nrrwrgn.vim | ||
obsession.vim | ||
po.vim | ||
promptline.vim | ||
quickfix.vim | ||
syntastic.vim | ||
tabline.vim | ||
tagbar.vim | ||
term.vim | ||
tmuxline.vim | ||
undotree.vim | ||
unicode.vim | ||
unite.vim | ||
vimagit.vim | ||
vimtex.vim | ||
virtualenv.vim | ||
whitespace.vim | ||
windowswap.vim | ||
wordcount.vim | ||
xkblayout.vim | ||
ycm.vim |