lifepillar / vim-mucomplete

Chained completion that works the way you want!
MIT License
913 stars 18 forks source link

Completion not triggered even when a list is returned #19

Closed sriramkswamy closed 8 years ago

sriramkswamy commented 8 years ago

I was trying to use this with auto completion enabled and trying to complete the world tolerance in one of my files but I got this instead

tpumvisible()?mucomplete#yup():''

'

and was put in the command line with an =.

Here's a small gif that explains what I'm trying to tell - vim-mucomplete

That GIF shows the file I'm trying to invoke mucomplete from. I have also tried disabling auto completion and evoking it manually. It didn't work either.

Here's my mucomplete settings.

Plug 'lifepillar/vim-mucomplete'
let g:mucomplete#no_mappings = 0
let g:mucomplete#auto_select = 0
let g:mucomplete#enable_auto_at_startup = 1
let g:mucomplete#exit_ctrlx_keys = "\<c-b>\<bs>"
let g:mucomplete#chains = {}
let g:mucomplete#chains.default = ['file', 'c-p']
let g:mucomplete#chains.markdown = ['keyn', 'spel', 'dict']
let g:mucomplete#chains.tex = ['omni', 'c-p', 'spel', 'dict']
let g:mucomplete#chains.vim = ['omni', 'cmd', 'file', 'c-p']
let g:mucomplete#chains.c = ['omni', 'tags', 'file', 'c-p']
let g:mucomplete#chains.cpp = ['omni', 'tags', 'file', 'c-p']
let g:mucomplete#chains.py = ['omni', 'tags', 'file', 'c-p']
let g:mucomplete#chains.java = ['omni', 'user', 'tags', 'file', 'c-p']
let g:mucomplete#chains.r = ['omni', 'tags', 'file', 'c-p']
let g:mucomplete#chains.ruby = ['omni', 'tags', 'file', 'c-p']
let g:mucomplete#chains.matlab = ['omni', 'file', 'c-p']
let g:mucomplete#exit_ctrlx_keys = "\<c-c>\<bs>"
nnoremap coa :MUcompleteAutoOn<CR>
nnoremap coo :MUcompleteAutoOff<CR>
imap <C-j> <Plug>(MUcompleteFwd)
imap <C-k> <Plug>(MUcompleteBwd)

I'm using MacVim on OS X 10.11.6

Here's my Vim version details

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 26 2016 23:02:21)
MacOS X (unix) version
Included patches: 1-46
Compiled by Homebrew
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl             +cmdline_compl   +digraphs        +folding         +lambda          +mouse           +multi_lang      +profile         +statusline      +timers          +wildignore      
+arabic          +cmdline_hist    +dnd             -footer          +langmap         +mouseshape      -mzscheme        -python          -sun_workshop    +title           +wildmenu        
+autocmd         +cmdline_info    -ebcdic          +fork()          +libcall         +mouse_dec       +netbeans_intg   +python3         +syntax          +toolbar         +windows         
+balloon_eval    +comments        +emacs_tags      +fullscreen      +linebreak       -mouse_gpm       +num64           +quickfix        +tag_binary      +transparency    +writebackup     
+browse          +conceal         +eval            -gettext         +lispindent      -mouse_jsbterm   +odbeditor       +reltime         +tag_old_static  +user_commands   -X11             
++builtin_terms  +cryptv          +ex_extra        -hangul_input    +listcmds        +mouse_netterm   +packages        +rightleft       -tag_any_white   +vertsplit       -xfontset        
+byte_offset     +cscope          +extra_search    +iconv           +localmap        +mouse_sgr       +path_extra      +ruby            +tcl             +virtualedit     +xim             
+channel         +cursorbind      +farsi           +insert_expand   +lua             -mouse_sysmouse  +perl            +scrollbind      +termguicolors   +visual          -xpm             
+cindent         +cursorshape     +file_in_path    +job             +menu            +mouse_urxvt     +persistent_undo +signs           +terminfo        +visualextra     -xsmp            
+clientserver    +dialog_con_gui  +find_in_path    +jumplist        +mksession       +mouse_xterm     +postscript      +smartindent     +termresponse    +viminfo         -xterm_clipboard 
+clipboard       +diff            +float           +keymap          +modify_fname    +multi_byte      +printer         +startuptime     +textobjects     +vreplace        -xterm_save      
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: clang   -L. -L/usr/local/lib -L. -L/usr/local/lib  -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon       -lm  -lncurses -liconv -framework Cocoa  -pagezero_size 10000 -image_base 100000000 -L/usr/local/opt/luajit/lib -lluajit-5.1 -fstack-protector  -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl  -L/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/config-3.5m -lpython3.5m -framework CoreFoundation -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby   

I think it satisfies all requirements.

lifepillar commented 8 years ago

Try to remove this line:

let g:mucomplete#exit_ctrlx_keys = "\<c-c>\<bs>"

Also, what is the output of: :imap <c-b> and :imap <c-r>? If you get something different from No mapping found, that's a problem.

lifepillar commented 8 years ago

Watched the asciicast, it looks like https://github.com/lifepillar/vim-mucomplete/issues/15. Do you have vim-peekaboo installed?

sriramkswamy commented 8 years ago

Yes, that was the problem. However, I have another question. When I try to write a word that is not in the auto completion list yet, it automatically deletes the last character that doesn't comply with that list. Is there a way to avoid this behavior?

For example, if I try to type install when the completion popups with insert and ins, it deletes the t character and leaves insall when I'm typing fast. Is this normal?

lifepillar commented 8 years ago

For example, if I try to type install when the completion popups with insert and ins, it deletes the t character and leaves insall when I'm typing fast. Is this normal?

Definitely not. But I cannot reproduce that problem. Please try with the following minimal vimrc_minimal:

set runtimepath+=/path/to/mucomplete/
set completeopt-=longest
set completeopt+=menu,menuone

Then:

vim -N -u vimrc_minimal

Let me know if you still see the problem.

sriramkswamy commented 8 years ago

I see that it works correctly with the minimal vimrc. I'm not sure what the problem is. I'll figure it out. Probably something to do with my config.