Closed petobens closed 10 years ago
I fixed the problem.
Thanks Shougo that indeed fixes the problem. I noticed another problem (that is maybe related to my regex but I'm pretty sure that it use to work before. Now if I type
\cref{sec:
It correctly completes to
\cref{sec:a_section}
But if I type
\cref{}
and then
\cref{sec:}
no completion happens. I don't know why this is happening. Thanks in advance and happy new year.
You must disable next_keyword_patterns.
let next_keyword_patterns = {}
let next_keyword_patterns = {'tex' : ''}
call neocomplete#custom#source('buffer', 'next_keyword_patterns',
\ next_keyword_patterns)
Thanks! That worked. What functionality does next_keyword_pattern
add? I read from the documentation but I don't understand this part
This dictionary records regular expression to recognize a
keyword pattern of the next than a cursor. The form is the ...
It recognizes keyword pattern of the word next to the cursor?
It recognizes keyword pattern of the word next to the cursor?
Yes.
Okay thanks again for the help!
One last question. Do I need to set
if !exists('g:neocomplete#next_keyword_patterns')
let g:neocomplete#next_keyword_patterns = {}
endif
before
let next_keyword_patterns = {}
let next_keyword_patterns = {'tex' : ''}
call neocomplete#custom#source('buffer', 'next_keyword_patterns',
\ next_keyword_patterns)
?
No. If you don't use global g:neocomplete#next_keyword_patterns
, you don't have to initialize.
Thanks for the explanation.
Hello Shougo, I'm terribly sorry to bother you again. As you told me, I was using the following
let next_keyword_patterns = {}
let next_keyword_patterns = {'tex' : ''}
call neocomplete#custom#source('buffer', 'next_keyword_patterns',
\ next_keyword_patterns)
However next_keyword_patterns
is deprecated now. So once again I have the problem I used to have here. How can I fix it? I read the docs but I don't know how or if I should use converter_remove_overlap
. Thanks in advance
Yes, this feature is deprecated. You can disable "converter_remove_overlap".
:help neocomplete#custom#filters()
I tried doing:
call neocomplete#custom#source('buffer', 'converters',
\ ['converter_delimiter', 'converter_case', 'converter_abbr'])
But my problem is not fixed. Additionally I would like to disable converter_remove_overlap
only for buffer source in tex files and not every file. Is there a way to do that? Thanks
Ok, I will try it. But your information is not enough. Please upload minimal .vimrc less than 50 lines and reproduce ways from Vim starting. You should upload sample tex file.
Here is the minimal vimrc:
set nocompatible
set runtimepath+=~/vimfiles/bundle/neocomplete/
set runtimepath+=~/vimfiles/bundle/vimproc/
let g:neocomplete#enable_at_startup = 1
if !exists('g:neocomplete#sources')
let g:neocomplete#sources = {}
endif
let g:neocomplete#sources.tex = ['buffer']
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns._ = '^\\\?\h\w*$'
let keyword_patterns = {}
let keyword_patterns = {'tex' : '\h\w*:\%(\w*_\w*\)\?'}
call neocomplete#custom#source('buffer', 'keyword_patterns',
\ keyword_patterns)
call neocomplete#custom#source('buffer', 'converters',
\ ['converter_delimiter', 'converter_case', 'converter_abbr'])
setfiletype tex
To reproduce create a file foo.tex
with the following contents
\section{A test}
\label{sec:a_test}
After doing :NeoCompleteClean
and :NeoCompleteBufferMakeCache
you will see that if you type \cref{sec:
then vim will complete to \cref{sec:a_test
but if you yank and paste \cref{sec:}
and place the cursor before the last parenthesis i.e \cref{sec:CURSOR HERE}
, then no completion happens.
No. It is works in my environment. So, it is not neocomplete problem.
It doesn't work for me: when I place the cursor before the brace no completion happens.
I cannot fix the problem. Because, it works in my envoriment. Can you fix the problem?
It doesn't work for me: when I place the cursor before the brace no completion happens.
You must input characters. Neocomplete does not complete on InsertEnter.
I believe thaat "You must input characters. Neocomplete does not complete on InsertEnter" is the solution to my problem! Thanks Shougo for the help and patience.
Hi Shougo. Thanks to your help here and here I was able to complete references in tex files. Using the following settings
if in a buffer I have something like this
If I type
it completes to
This used to work great until this commit. Since that commit buffer completion stopped working.
I also noticed that before that commit if I ran the command
echo neocomplete#get_keyword_pattern('tex', 'buffer')
I would get as a result\h\w*:\%(\w*_\w*\)\?
and after the problematic commit i get the following error: