Set omnifunc in GitHub Enterprise repositories

This commit is contained in:
Tim Pope
2015-11-30 21:53:19 -05:00
parent cde64b17ca
commit d7801e77ca
2 changed files with 15 additions and 10 deletions

View File

@@ -21,8 +21,9 @@ augroup rhubarb
\ if expand('%:p') =~# '\.git[\/].*MSG$' &&
\ exists('+omnifunc') &&
\ &omnifunc =~# '^\%(syntaxcomplete#Complete\)\=$' &&
\ join(readfile(fugitive#buffer().repo().dir('config')),"\n")
\ =~# '\n[^;]*github\.com' |
\ !empty(filter(
\ readfile(fugitive#buffer().repo().dir('config')),
\ '!empty(rhubarb#homepage_for_url(matchstr(v:val, ''^\s*url\s*=\s*"\=\zs\S*'')))')) |
\ setlocal omnifunc=rhubarb#omnifunc |
\ endif
autocmd BufEnter *