Closed Konfekt closed 9 years ago
Please read issue template.
https://github.com/Shougo/neocomplete.vim/issues/236
I cannot understand and reproduce your problem.
Ok. Put shortly, if necomplete is enabled, but autocompletion disabled, then user completion by <c-x><c-u>
does not work if invoked twice while staying in insert mode. A step by step description follows later.
I cannot understand it again. You should upload sample Tex file and more detailed description(if possible screenshot).
.vimrc:
filetype plugin indent on
syntax enable
set runtimepath+=~/.vim/bundle/neocomplete.vim/
let g:neocomplete#disable_auto_complete = 1
let g:neocomplete#enable_at_startup = 1
Start VIM. Then itest<cr>te
gives
test
te*
with * indicating the cursor position. Hit <c-x><c-u>
to obtain
test
test*
Type <space>te<c-x><c-u>
.
Expected:
test
test test*
Obtained:
test
test*
OK. I get it. It is feature.
You must use neocomplete#start_manual_complete()
instead of <c-x><c-u>
.
inoremap <expr><Tab> neocomplete#start_manual_complete()
Ok. Thank you. Better be documented. I used
" <TAB> completion
inoremap <expr> <TAB> pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" : "\<C-X>\<C-U>"
function! s:check_back_space()
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
and thought it to be smart as it accounts for any kind of user completion.
It is already documented in examples.
" For smart TAB completion.
"inoremap <expr><TAB> pumvisible() ? "\<C-n>" :
" \ <SID>check_back_space() ? "\<TAB>" :
" \ neocomplete#start_manual_complete()
" function! s:check_back_space() "{{{
" let col = col('.') - 1
" return !col || getline('.')[col - 1] =~ '\s'
" endfunction"}}}
and thought it to be smart as it accounts for any kind of user completion.
It is impossible because implementation problem.
Ok. Perhaps add a comment about the necessity of start_manual_complete instead of user completion.
My
.vimrc
readsThen, for example in a TeX file, hitting
<c-x><c-u>
on a word with no completion suggestions, Vim throws an errorE121: variable words not defined
.If however suggestions existed, then NeoComplete works fine and shows the popup menu. However, afterwards, the second time, it deletes everything up to the last position where
<c-x><c-u>
was hit and completes by the same word. This stops as soon as insert mode is quit and reentered.