-
Notifications
You must be signed in to change notification settings - Fork 0
/
init_floggit.vim
41 lines (33 loc) · 1.15 KB
/
init_floggit.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
let g:floggit_config_dir = expand('~/.floggit')
call plug#begin(g:floggit_config_dir . '/plugged')
if filereadable(g:floggit_config_dir . "/plugins.vim")
execute "source " . g:floggit_config_dir . "/plugins.vim"
else
execute "source " . expand("$FLOGGIT_DIR/default_plugins.vim")
endif
if filereadable(g:floggit_config_dir . "/extra_plugins.vim")
execute "source " . g:floggit_config_dir . "/extra_plugins.vim"
endif
call plug#end()
execute "source " . expand("$FLOGGIT_DIR/settings.vim")
function! Floggit_Start() abort
execute ":only"
if !empty(FugitiveGitDir())
let l:opencmd='-open-cmd=edit'
if exists('*autoflog#open_flog')
call autoflog#open_flog()
elseif exists('*flogmenu#open_git_log')
call flogmenu#open_git_log(l:opencmd)
else
execute ':Flog -all ' . l:opencmd
endif
else
" TODO fuzzy search for git repo's
execute "e ."
endif
endfunction
command! -nargs=0 Floggitstart call Floggit_Start()
" source floggitrc.vim here, so that Floggit_Start() can be overridden there
if filereadable(expand(g:floggit_config_dir . "/floggitrc.vim"))
execute "source " . g:floggit_config_dir . "/floggitrc.vim"
endif