Fix pandoc citation autocompletions

wiki.vim overwrites omnifunc for any buffer it sees as its own. Pandoc
uses g:pandoc#competion#Complete as its omnifunc to generate citations.

So we use deoplete to collect the citations and display them on being
invoked by `@`. When typing more, it filters the list accordingly.

Have not gotten preview window working again, nor searching of fields
other than bibkey.
This commit is contained in:
Marty Oehme 2020-02-04 00:44:12 +01:00
parent 756e45e037
commit e7ff8c9f78
6 changed files with 24 additions and 38 deletions

View file

@ -0,0 +1,22 @@
" PLUGIN: DEOPLETE
" For async completion
" enable deoplete at startup
let g:deoplete#enable_at_startup =1
let g:deoplete#enable_ignore_case =1
let g:deoplete#enable_smart_case =1
let g:deoplete#enable_camel_case =1
let g:deoplete#enable_refresh_always =1
let g:deoplete#max_abbr_width =0
let g:deoplete#max_menu_width =0
call deoplete#custom#var('omni', 'input_patterns', {
\'pandoc': '@\w*',
\})
call deoplete#custom#var('omni', 'functions', {
\'pandoc': 'pandoc#completion#Complete',
\})
call deoplete#custom#option({
\ 'auto_complete_delay': 0,
\ 'smart_case': v:true,
\})