Recent commits broke omnifun autocompletion with vimtex
See original GitHub issueBefore commit 22d80bc0b93c942eeb07d9c5cbd2ae6927d3cd64, the following setup correctly autocompleted:
minimal vimrc
call plug#begin('~/.vim/plugged')
Plug 'roxma/nvim-yarp'
Plug 'ncm2/ncm2'
Plug 'lervag/vimtex'
call plug#end()
au BufEnter * call ncm2#enable_for_buffer()
au User Ncm2Plugin call ncm2#register_source({
\ 'name' : 'vimtex',
\ 'priority': 1,
\ 'subscope_enable': 1,
\ 'complete_length': 1,
\ 'scope': ['tex'],
\ 'mark': 'tex',
\ 'word_pattern': '\w+',
\ 'complete_pattern': g:vimtex#re#ncm,
\ 'on_complete': ['ncm2#on_complete#omni', 'vimtex#complete#omnifunc'],
\ })
set completeopt=noinsert,menuone,noselect
test files
test.bib (needs to be in the same directory)
@article{A1,
author = {Author, A.},
journal = {Good Journal},
year = {2001},
title = {Alpha},
}
@article{A2,
author = {Author, A.},
journal = {Very Good Journal},
year = {2008},
title = {Bravo},
}
@article{B3,
author = {Buthor, C.},
journal = {Also Good Journal},
year = {2004},
title = {Charlie},
}
test.tex (the main file)
\documentclass{article}
\begin{document}
\bibliographystyle{plain}
\bibliography{test.bib}
\end{document}
steps to reproduce
First problem:
nvim -u vimrc test.tex- in the empty line after
\begin{document}, type\cit
- expected:
ncm2suggests\cite(same as<c-x><c-o>) - observed: nothing happens
If I revert to 7feca385009bc62a844b8ffa98119edc7a2f8667, autocomplete works here as expected.
Second problem:
nvim -u vimrc test.tex- in the empty line after
\begin{document}, type(!)\cite{A
Important: do not let ncm2 complete the \cite command! Otherwise the issue won’t occur.
- expected:
ncm2suggestsA1andA2(same as<c-x><c-o>) - observed: nothing happens
Note: just typing \cite{ does suggest A1, A2, B1 as expected; it’s just the further filtering that no longer works. If I revert to 0fd55917436284c429d9895ce2ac42e8902d3bf5, the filtering works as expected.
os
This happens with neovim release 0.3.0 as well as v0.3.1-180-g487421413, on macOS as well as Linux.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Documentation for ncm2 · Issue #1160 · lervag/vimtex - GitHub
I am still struggling to get vimtex completion working here. ... Recent commits broke omnifun autocompletion with vimtex ncm2/ncm2#22.
Read more >vimtex.txt - GitHub
VimTeX maintains a list of latex packages that are required by the current project. This list is used by VimTeX for instance to...
Read more >non latin identifier based autocompletion - vim - Stack Overflow
I dont want any complicated completion as i understand that it is nearly impossible with the current implementation of vim.
Read more >neovim/neovim - Gitter
I get some strange behaviour sometimes where nvim just forgets parts of my config, and all of a sudden tabs are tabs instead...
Read more >vimrc · master · mtrame / vim-config - EECS Gitlab
Show partial commands in the last line of the screen ... Allow backspacing over autoindent, line breaks and start of insert action.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Still works!
You’re right, this would even better – but now it no longer completes based on the author string (
\cite{A|)? (EDIT: and neither does\cicomplete to\cite.)