Open hanqing0521 opened 7 years ago
It was opened 3 years ago but nothing seems change... facing same issue and I don't know how to improve it ....
I find a simple fix for vim-mucomplete
. It should also work for other auto-complete plugins that only inserts (
func! CondInsert()
" Insert )\<Left> only if the previous character is not )
let line = getline('.')
let pos = col('.') - 2
if strgetchar(line, pos) != char2nr(')')
return ")\<Left>"
endif
return ""
endf
autocmd! CompleteDone * if has_key(v:completed_item, 'word') && v:completed_item.word =~# '($'
\| call feedkeys("\<C-R>=CondInsert()\<CR>")
\| endif
1. neocomplete support Omni completion for pythonn, and it complete functions with" (" but this auto-pairs do not complete this "(" by add ")"
2. If i have written a () than neocomplete complete a function with "(" , this auto-pairs will regard the next ")" as the "(" of neocompete completed fucntion"(".