Shougo / neocomplete.vim

Next generation completion framework after neocomplcache
2.74k stars 203 forks source link

conflict with ftdplugin enabled? #577

Closed sesselastronaut closed 7 years ago

sesselastronaut commented 7 years ago

Don't sure if this is a 'plain' neocomplete issue as I use neocomplete and vimtex together. If the following line in my vimrc is uncommented: let b:did_ftplugin = 1 and I try to use the completion of e.g. \cite{ in a .tex file by pressing <C-x><C-o> vim returns: E764: Option 'omnifunc' is not set With the above line in comments it works as expected and brings up the options from the .bib file.

This occurs on Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux 9 (stretch) with VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 07 2017 03:33:23) Included patches: 1-197, 322, 377-378

This is a MWE vimrc:

filetype plugin indent on
syntax enable
"" uncomment/comment the following line to reproduce
let b:did_ftplugin = 1
let &rtp  = '~/.vim/bundle/vimtex,' . &rtp
let &rtp .= ',~/.vim/bundle/vimtex/after'
let g:tex_flavor = 'latex'
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_camel_case = 1
let g:neocomplete#enable_auto_delimiter = 1
let g:neocomplete#enable_auto_close_preview = 1
let g:neocomplete#keyword_patterns = {}
let g:neocomplete#sources#omni#input_patterns = {}
let g:neocomplete#keyword_patterns.tex = '[a-zA-ZæÆøØåÅ][0-9a-zA-ZæÆøØåÅ]\+'
let g:neocomplete#sources#omni#input_patterns.tex =
      \ '\v\\\a*(ref|cite)\a*([^]]*\])?\{([^}]*,)*[^}]*'

to reproduce

  1. place the above vimrc in a folder e.g. as test.vimrc
  2. setup a test.tex:
    \bibliographystyle{amsplain}
    \begin{document}
    \cite{
    \bibliography{TeX}
    \end{document}

    and a TeX.bib next to it:

    @book{diller97,
    author = "Antoni Diller",
    title = "{\LaTeX} Line by Line",
    year = "1997",
    edition = "1st",
    publisher = "Wiley",
    address = "Chichester, England"
    }
  3. start vim vim -u test.vimrc test.tex
  4. go the end of the line with \cite{ and press <C-x> <C-o> in insert mode
Shougo commented 7 years ago

ftplugin set omnifunc.

let b:did_ftplugin = 1

It disables ftplugin, so omnifunc feature is disabled.