Closed bo5o closed 6 years ago
I think vimtex source (omnifunc?) does not support Umlaut autocompletion.
g:neocomplete#keyword_patterns
only works for buffer source.
No, I think this is because of the g:vimtex#re#neocomplete
, which should probably also include the umlauts. But I'm not quite sure; it seems you are specifically talking about keywords, which I take as "normal" words in the text. The omnifunc from vimtex supports a lot of different LaTeX related stuff, such as commands, bibliography, references, etc, but not keywords.
As always, it would be very helpful if you could provide a specific and explicit example (as suggested by the issue template). An example with what you do, what you expect, and what happens is a minimum.
Note: You could always copy the g:vimtex#re#neocomplete
regex and modify it to allow umlauts. I've mostly used the \a
atom to match characters, which only allows [A-Za-z]
. Thus you could try to copy the variable and change these \a
s to your []
form.
Thank you for your comments. I was worried that a minimal working example would be too minimal and therefore redundant. But I will give it a try.
I open up a file test.txt
(or really any other filetype except .tex
) and type the following:
Aufzählungen
Au
The neocomplete popup suggests the full word Aufzählungen
as expected since it's the only match.
I open up a file test.tex
and type the following (this is just filetype related so I can leave out the preamble etc):
Aufzählungen
Au
The neocomplete popup suggests only Aufz
which is not my desired behaviour. I can always press <c-x><c-n>
and the full word appears.
And this is really the only use case for me since I never put umlauts in labels, bibkeys, commands and so on. So you were exactly right, I'm only concerned about "normal" words.
Ok. What is the output of :echo g:neocomplete#keyword_patterns['tex']
?
I find this strange, though. One should think that setting the g:neocomplete#sources#omni#input_patterns.tex
would not conflict with the keyword completion. Do you have a comment on this, @Shougo?
For this specific minimal example the output of :echo g:neocomplete#keyword_patterns['tex']
is
\\\a{\a\{1,2}}\|\\[[:alpha:]@][[:alnum:]@]*\%({\%([[:alnum:]:_]\+\*\?}\?\)\?\)\?\|\a[[:alnum:]:_]*\*\?
I get it.
@cbows You must overwrite tex pattern in g:neocomplete#keyword_patterns
.
It does not includes Umlauts.
let g:neocomplete#keyword_patterns.tex = '[A-Za-zÄÖÜäöüß_][0-9A-ZÄÖÜäöüß_]*'
That was also my suspicion. Thanks, @Shougo.
Thank you it works. This was very helpful.
Explain the issue
I added umlauts to the neocomplete
keyword_patterns
like so:Now neocomplete suggests words with umlauts as well. However this does not work in any of my tex files. Whenever neocomplete popup shows suggestions in a tex file, the umlauts are not included (only the parts of the word before or after the umlaut).
Minimal vimrc file
My neocomplete and vimtex settings: