Code Monkey home page Code Monkey logo

vim-mucomplete's People

Contributors

3ernhard avatar jiz4oh avatar konfekt avatar kristijanhusak avatar lifepillar avatar mg979 avatar skeept avatar vigoux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-mucomplete's Issues

MUcomplete autocomplete looks for match with every keystroke, even after failure

If I type a long string for which none of MUcomplete's completion methods can find any matches, each new character results in spamming the command line area with "Pattern not found" messages (and in the case of c-n completion, a bell). Not sure if this is at all avoidable, but it's frustrating.


For bug reports only, please provide the following details:

  • I have followed the instructions in :help mucomplete-troubleshooting.
  • Output of echo g:mucomplete#chains: {'default': ['omni', 'c-n', 'file', 'dict']}
  • Output of setl completeopt: completeopt=menu,noselect
  • MUcomplete settings in my .vimrc, if any:
let g:mucomplete#no_mappings = 1
let g:mucomplete#trigger_auto_pattern = { 'default' : '\k\k\k\k$' }
let g:mucomplete#enable_auto_at_startup = 1
imap <c-j> <plug>(MUcompleteFwd)
inoremap <silent> <plug>(MUcompleteFwdKey) <right>
imap <right> <plug>(MUcompleteCycFwd)
inoremap <silent> <plug>(MUcompleteBwdKey) <left>
imap <left> <plug>(MUcompleteCycBwd)

let g:mucomplete#chains = { 'default': ['omni', 'c-n', 'file', 'dict'] }

Is 'menu' needed in 'completeopt'?

Hi,

If completeopt contains menuone, is menu needed (mentioned as mandatory).
Reading from vim's documentation, it seems that menuone subsumes menu. Am I missing something?

Regards,
Manas

provide a way to abort the completion menu

Hello,

Please provide a way to abort the completion menu because, currently, as soon as I press <Tab> to cycle through the completion menu, it instantly becomes too late 😱 for me to change my mind:

  • Pressing <C-C> dismisses the completion menu but also leaves behind 😱 the most recently selected menu item inserted into the buffer.
  • Pressing u to undo the above unwanted completion-menu-insertion also undoes 😱 all the text I've written before interacting with the completion menu.

For example, NeoComplete provides this functionality that I can bind to <C-G> as follows:

" <C-G>: cancel.
inoremap <expr><C-G> neocomplete#cancel_popup()

Thanks for your consideration.

Undefined variable: g:mucomplete#can_complete

Using NeoVim 0.1.5, in a brand new buffer, typing "hello" and then pressing TAB causes this error: 💣

Error detected while processing function mucomplete#complete[7]..<SNR>370_complete[5]..mucomplete#complete_chain:
line    5:
E121: Undefined variable: g:mucomplete#can_complete
Press ENTER or type command to continue

Syntax error on vim startup

I get the following output when trying to use terminal vim on OSX 10.11.3:

Error detected while processing .../bundle/vim-mucomplete/autoload/mucomplete.vim:
line   42:
E15: Invalid expression: > 1 } " Try always
E15: Invalid expression: { _ -> 1 } " Try always
line   53:
E15: Invalid expression: > strlen(&l:dictionary) > 0 },     'file':  { t -> t =~# s:slash },     'omni':  { t -> strlen(&l:omnifunc) > 0 },     'spel':  { t -> &l:spell },     'tags':  { t -> !empty(tagfiles()) },     'thes':  { t -> strlen(&l:thesaurus) > 0 },     'user':  { t -> strlen(&l:completefunc) > 0 }   }, get(get(g:, 'mucomplete#can_complete', {}), 'default', {})) }, get(g:, 'mucomplete#can_complete', {}), 'keep')
E116: Invalid arguments for function extend({     'dict':  { t -> strlen(&l:dictionary) > 0 },     'file':  { t -> t =~# s:slash },     'omni':  { t -> strlen(&l:omnifunc) > 0 },     'spel':  { t -> &l:spell },     'tags':  { t -> !empty(tagfiles()) },     'thes':  { t -> strlen(&l:thesaurus) > 0 },     'user':  { t -> strlen(&l:completefunc) > 0 }   }, get(get(g:, 'mucomplete#can_complete', {}), 'default', {})) }, get(g:, 'mucomplete#can_complete', {}), 'keep')
E116: Invalid arguments for function extend({ 'default' : extend({     'dict':  { t -> strlen(&l:dictionary) > 0 },     'file':  { t -> t =~# s:slash },     'omni':  { t -> strlen(&l:omnifunc) > 0 },     'spel':  { t -> &l:spell },     'tags':  { t -> !empty(tagfiles()) },     'thes':  { t -> strlen(&l:thesaurus) > 0 },     'user':  { t -> strlen(&l:completefunc) > 0 }   }, get(get(g:, 'mucomplete#can_complete', {}), 'default', {})) }, get(g:, 'mucomplete#can_complete', {}), 'keep')
E15: Invalid expression: extend({ 'default' : extend({     'dict':  { t -> strlen(&l:dictionary) > 0 },     'file':  { t -> t =~# s:slash },     'omni':  { t -> strlen(&l:omnifunc) > 0 },     'spel':  { t -> &l:spell },     'tags':  { t -> !empty(tagfiles()) },     'thes':  { t -> strlen(&l:thesaurus) > 0 },     'user':  { t -> strlen(&l:completefunc) > 0 }   }, get(get(g:, 'mucomplete#can_complete', {}), 'default', {})) }, get(g:, 'mucomplete#can_complete', {}), 'keep')

I further get this error when vim starts and I enter insert mode:

screen shot 2016-10-25 at 3 19 01 pm

Output of vim --version:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 24 2016 14:46:16)
MacOS X (unix) version
Included patches: 1-1401
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+channel         -gettext         -mzscheme        +textobjects
+cindent         -hangul_input    +netbeans_intg   +title
-clientserver    +iconv           +packages        -toolbar
+clipboard       +insert_expand   +path_extra      +user_commands
+cmdline_compl   +job             +perl            +vertsplit
+cmdline_hist    +jumplist        +persistent_undo +virtualedit
+cmdline_info    +keymap          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       +python          +vreplace
+cscope          +lispindent      -python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con      -lua             +rightleft       +writebackup
+diff            +menu            +ruby            -X11
+digraphs        +mksession       +scrollbind      -xfontset
-dnd             +modify_fname    +signs           -xim
-ebcdic          +mouse           +smartindent     -xsmp
+emacs_tags      -mouseshape      -sniff           -xterm_clipboard
+eval            +mouse_dec       +startuptime     -xterm_save
+ex_extra        -mouse_gpm       +statusline      -xpm
+extra_search    -mouse_jsbterm   -sun_workshop

Interestingly, I don't get this error when using MacVim.

uspl doesn't honour completeopt+=noinsert

For bug reports only, please provide the following details:

  • I have followed the instructions in :help mucomplete-troubleshooting.
  • Output of echo g:mucomplete#chains: let g:mucomplete#chains = { 'default' : ['file', 'omni', 'keyn', 'uspl'] }
  • Output of setl completeopt: menu,preview,menuone,preview,noinsert,noselect
  • MUcomplete settings in my .vimrc, if any:
let g:mucomplete#enable_auto_at_startup = 0
set completeopt+=menuone,preview,noinsert,noselect
set shortmess+=c
let g:mucomplete#chains = { 'default' : ['file', 'omni', 'keyn', 'uspl'] }

The new uspl doesn't seem to honour the noinsert flag of completeopt.
If I do :setlocal spelllang=en_au and type hel, then press tab, straight away my text is replaced with Heel. I get a menu with options, Heel is the first and is unselected.

If I type hel and press ctrl-x-s then I get the expected behaviour - a list of options (of which Heel is the first) nothing is selected and my word isn't changed.

Maybe this is by design, or I misunderstand how it's supposed to work? If so, I again apologise for time wasting!

Error detected while processing autoload/mucomplete.vim

With this line in my vimrc:

let g:mucomplete#enable_auto_at_startup = 1

I get this error at NeoVim 0.1.5 startup:

Error detected while processing autoload/mucomplete.vim:
line   40:
E15: Invalid expression: > 1 } " Try always
E15: Invalid expression: { _ -> 1 } " Try always
line   51:
E15: Invalid expression: > strlen(&l:dictionary) > 0 },     'file':  { t -> t =~# '/' },     'omni':  { t -> strlen(&l:omnifunc) > 0 },     'spel':  { t -> &l:spell },     'tags':  { t -> !empty(tagfiles()) },     'thes':  { t -> strlen(&l:thesaurus) > 0 },     'user':  { t -> strlen(&l:completefunc) > 0 }   }, get(get(g:, 'mucomplete#can_complete', {}), 'default', {})) }, get(g:, 'mucomplete#can_complete', {}), 'keep')
E116: Invalid arguments for function extend({     'dict':  { t -> strlen(&l:dictionary) > 0 },     'file':  { t -> t =~# '/' },     'omni':  { t -> strlen(&l:omnifunc) > 0 },     'spel':  { t -> &l:spell },     'tags':  { t -> !empty(tagfiles()) },     'thes':  { t -> strlen(&l:thesaurus) > 0 },     'user':  { t -> strlen(&l:completefunc) > 0 }   }, get(get(g:, 'mucomplete#can_complete', {}), 'default', {})) }, get(g:, 'mucomplete#can_complete', {}), 'keep')
E116: Invalid arguments for function extend({ 'default' : extend({     'dict':  { t -> strlen(&l:dictionary) > 0 },     'file':  { t -> t =~# '/' },     'omni':  { t -> strlen(&l:omnifunc) > 0 },     'spel':  { t -> &l:spell },     'tags':  { t -> !empty(tagfiles()) },     'thes':  { t -> strlen(&l:thesaurus) > 0 },  'user':  { t -> strlen(&l:completefunc) > 0 }   }, get(get(g:, 'mucomplete#can_complete', {}), 'default', {})) }, get(g:, 'mucomplete#can_complete', {}), 'keep')
E15: Invalid expression: extend({ 'default' : extend({     'dict':  { t -> strlen(&l:dictionary) > 0 },     'file':  { t -> t =~# '/' },     'omni':  { t -> strlen(&l:omnifunc) > 0 },     'spel':  { t -> &l:spell },     'tags':  { t -> !empty(tagfiles()) },     'thes':  { t -> strlen(&l:thesaurus) > 0 },     'user':  { t -> strlen(&l:completefunc) > 0 }   }, get(get(g:, 'mucomplete#can_complete', {}), 'default', {})) }, get(g:, 'mucomplete#can_complete', {}), 'keep')
Press ENTER or type command to continue

less common exit_ctrlx_key

How about let g:mucomplete#exit_ctrlx_keys = "\<c-_>\<bs>" (instead of the default <c-b><bs>) as it is less likely to be remapped?

Error using vim 7.3

With vim 7.4, compiled with both +insert_expand and +menu, the following error is encountered on starting vim:

Error detected while processing function mucomplete#enable_auto:
line    4:
E216: No such group or event: TextChangedI * noautocmd if s:completedone | let s:completedone = 0 | else | silent call mucomplete#autocomplete() | endif
line    6:
E216: No such group or event: CompleteDone * noautocmd let s:completedone = 1
[/code]
tim@beaker ~ $ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Feb 10 2013 06:46:29)
Included patches: 1-547
Modified by [email protected]
Compiled by buildd@
Huge version without GUI.  Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv
+insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
+mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse
+mouse_xterm +mouse_urxvt +multi_byte +multi_lang -mzscheme +netbeans_intg
+path_extra -perl +persistent_undo +postscript +printer +profile -python
-python3 +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
 -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
 -xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -Wl,-z,relro -Wl,--as-needed -o vim       -lm -ltinfo -lnsl  -lselinux -lacl -lattr -lgpm

From my .vimrc

" µcomplete
let g:mucomplete#enable_auto_at_startup = 1
let g:peekaboo_ins_prefix = '<c-x>'

Add support for ctrl-x ctrl-n during keyword completion

According to :h i_CTRL-X_CTRL-N, during keyword completion “further use of CTRL-X CTRL-N or CTRL-X CTRL-P will copy the words following the previous expansion in other contexts unless a double CTRL-X is used”. Can we streamline this in µcomplete? If so, how?

Adding the value 'noselect' to the option 'completeopt' breaks undo sequence

Hello,

If I write the following text inside /tmp/vimrc.vim:

set cot=noselect,menu,menuone
set rtp+=~/.vim/plugged/vim-mucomplete

" people_A
" people_B
" people_C

" hello world
" hello world
" hello world

And then if I run Vim from the shell like this:

vim -Nu /tmp/vimrc.vim /tmp/vimrc.vim

I put the cursor on the word world and hit * to populate the search register.
I hit cgn to change the next occurrence of the search register (here world).
I insert pe and hit Tab to complete. The plugin inserts people_A, and the menu suggests people_A, people_B and people_C. It doesn't select any entry, respecting the value noselect.

If I then hit escape to go back to normal mode, then the dot command to repeat the last change, the next occurrence of world is replaced with pe instead of people_A like I expected.

The problem comes from the function s:act_on_pumvisible(), and more specifically from this line:

 \ : get(s:select_entry, s:compl_methods[s:i], "\<c-n>\<up>")

Its purpose is to hit C-n Up after the pop-up menu has been opened, if 'completeopt' contains the value 'noselect', in order to force the insertion of the first or last entry from the menu.

I think the keys <Up> and <Down> are special, insofar as they break the undo sequence, as described in :h ins-special-special. Breaking the undo sequence means that the dot register discards the text that was inserted so far, and records only from the current point. It can be checked in the current case by looking at the output of :reg..

Usually, when you want the dot command to repeat the last edit entirely, and it contains a special key, you prefix the latter with C-g U which preserves the undo sequence (see :h i_^gU). But here it doesn't seem to work. Hitting C-g makes us leave the pop-up menu.

I must admit I don't really understand the bug, for 2 different reasons.
First, if <Up> or <Down> break the undo sequence, then, in the last example, the dot command shouldn't repeat pe but ople_A.
Second, why do they break the undo sequence, when 'completeopt' contains the value noselect and s:act_on_pumvisible() hit C-n Up, but they don't seem to break it when 'completeopt' does NOT contain noselect but DOES contain noinsert and s:act_on_pumvisible() hit Up C-n?

To be clear, this isn't a bug in the plugin. It seems to be a standard behavior from Vim, but I don't understand it. And it causes the plugin to break the undo sequence when 'completeopt' contains noselect. I don't know if it deserves a fix, and if it does, I have no idea how to write one.

You could replace C-n Up and C-p Down with simply C-n and C-p. It would preserve the undo sequence, but it wouldn't respect the user setting set completeopt+=noselect, because then an entry from the menu would be selected, regardless of the option's value.

`C-l` (cycling forward) is shadowed by a standard mapping

Hello,

If I write this in /tmp/vimrc.vim:

set cot=menu,menuone
set rtp+=~/.vim/plugged/vim-mucomplete/
set dictionary=/usr/share/dict/words

let g:mucomplete#chains = {}
let g:mucomplete#chains.default = ['keyn', 'line', 'dict']

" foofoo   word
" foobar   word
" foobaz   word
" foo

And if I start Vim like this:

vim -Nu /tmp/vimrc.vim /tmp/vimrc.vim

I position the cursor on the last line after foo and try to complete it by hitting Tab. The pop-up menu appears and gives me suggestions (foofoo, foobar, foobaz). If I hit C-l to cycle forward in the chain, the plugin tries the line method, which gives me another menu displaying the 3 previous lines. But if I hit C-l again, instead of cycling forward again and try the dict method, the menu selects the previous entry in the menu (as described in :h i_^x^l).

Here's how it looks: http://imgur.com/a/Donh8

I tried to remap the standard C-l to various things, but no matter what I did, when the pop-up menu is visible and after hitting C-x C-l, C-l always does the same thing, it selects the previous entry in the menu.

For example, I tried to simply disable it, like this:

ino <expr> <C-l> pumvisible() ? '' : ''

It works except when we open the pop-up menu with C-x C-l.

In other words, the behavior of C-l is inconsistent, it cycles forward in the chain as long as the current method is different than line completion. But it cycles backward in the menu as soon as the current method is line completion.

I have no idea how to fix this.

There's another problem, which is not very important because the plugin allows to change the default mappings.

By default, to cycle forward or backward in the chain, we have to hit C-l or C-h. These keys are very useful by default. They respectively add and delete a character from the current match and the pop-up menu is updated accordingly, as described in :h popupmenu-keys:


In the first state these keys have a special meaning:
<BS> and CTRL-H   Delete one character, find the matches for the word before
		  the cursor.  This reduces the list of matches, often to one
		  entry, and switches to the second state.
Any non-special character:
		  Stop completion without changing the match and insert the
		  typed character.

In the second and third state these keys have a special meaning:
<BS> and CTRL-H   Delete one character, find the matches for the shorter word
		  before the cursor.  This may find more matches.
CTRL-L		  Add one character from the current match, may reduce the
		  number of matches.
any printable, non-white character:
		  Add this character and reduce the number of matches.

As an alternative, we could also define C-j and C-k to cycle in the chain. Instead of imagining the chain horizontally, one would imagine it vertically. We would lose the ability to insert a digraph while the pop-up menu is visible, but I think the default functions provided by C-h and C-l are far more important.

I know one could write:

ino <silent> <plug>(MUcompleteFwdKey) <c-j>
imap         <c-j>                    <plug>(MUcompleteCycFwd)
ino <silent> <plug>(MUcompleteBwdKey) <c-k>
imap         <c-k>                    <plug>(MUcompleteCycBwd)

I just think that C-j and C-k would be more sensible defaults than C-h and C-l. Any user which doesn't read the documentation will be surprised to see that the behavior of C-h and C-l changed. C-j and C-k are less obtrusive.

Note that if you were to agree, unfortunately, it wouldn't solve the previous issue, the same problem would occur, but for a different method. Replace line with dict and we have, again, the exact same issue.

The behavior of C-k would also be inconsistent, it would cycle backward in the chain as long as the current method is different than dictionary completion. But it would cycle forward in the menu as soon as the current method is dictionary completion.

Completion methods are skipped even if they return results

Some completion methods may be skipped in some circumstances, even when they have high priority and they return (possibly, not very quickly) some results. The problem can be reproduced with line completion. Set:

let g:mucomplete#chains.default = ['line', 'keyn']
set showmode shortmess-=c

then insert this text:

So long as men can breathe, or eyes can see,
So long lives this, and this gives life to thee.

Enable automatic completion and type iSo. Line completion is triggered, as expected, but µcomplete goes on trying (not local, btw!) keyword completion.

This issue affects 'tags', 'line', 'dict' (see #7 and #9) and omni/user completion from some plugins (notably, clang_complete).

The reason is that pumvisible() returns 0 when it is expected to return 1 in mucomplete#complete_chain(). Interestingly, if I “slow down” mucomplete#complete_chain() by putting sleep commands, I can see that pumvisible() returns 0 when the popup menu is actually visible.

Not sure if I have hit a bug in Vim or it is just a problem of buffering/typeahead or another timing issue.

CPU issue with ultisnips

I've been using this plugin for some time, it is very nice. but I can not make mucomplete work with ultisnips.CPU is high load, vim no response.
error

vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 17 2017 00:01:12)
MacOS X (unix) version
Included patches: 1-473

settings:

set noshowmode shortmess+=c
set noinfercase
set completeopt-=preview
set completeopt+=longest,menuone,noinsert,noselect

let g:mucomplete#chains = {
		\ 'default' : ['file', 'omni', 'keyn', 'dict'],
		\ 'vim'     : ['file', 'cmd', 'keyn'],
		\ 'python'  : ['file', 'omni', 'ulti'],
		\ 'cpp'     : ['file', 'ulti', 'keyn', 'incl', 'omni', 'dict']
		\ }

let g:mucomplete#enable_auto_at_startup = 1

imap <Leader>j <plug>(MUcompleteCycFwd)
imap <Leader>k <plug>(MUcompleteCycBwd)

How can I solve this problem?

add mappings to enter subdirectory in path completion

Perhaps this mapping is useful when completing file paths, and could become an option or make it into the docs:

When completing a file path (say /home/ and hitting <tab>) , and after having chosen a directory by iteratively hitting <tab> (say /home/user) , hitting / allows you to continue completing the file names inside it (that is, /home/user/...:

let s:slash = has('win32') ? '\' : '/'
exec 'inoremap <expr> ' . s:slash . ' '
      \ . '(pumvisible() && <SID>isBehindDir()) ?'
      \ . '"<C-Y><C-X><C-F>" : "' . s:slash . '"'

let s:escaped_slash = escape(s:slash, '\')
function! s:isBehindDir()
  return getline('.') =~# '\f\+` . s:escaped_slash . '$' 
endfunction

spel not working

Under Vim 8.45, if

let g:mucomplete_chains = {
      \ 'default':  ['spel']
      \ }

and &l:spell and &l:spelllang=en, for example hitting <tab> after crasy does not do anything. Expected: the menu shown by hitting <c-x><c-s>.

Cursor Jumping when using spel

For bug reports only, please provide the following details:

  • I have followed the instructions in :help mucomplete-troubleshooting.
  • Output of echo g:mucomplete#chains:
let g:mucomplete#chains = {
      \ 'default' : ['file', 'omni', 'keyn', 'dict', 'spel']
      \ }
  • Output of setl completeopt: menu, preview'
  • MUcomplete settings in my .vimrc, if any:
let g:mucomplete#chains = {
      \ 'default' : ['file', 'omni', 'keyn', 'dict', 'spel']
      \ }

If your problem has to do with specific completion methods, please provide the
output of the relevant settings among the following:

spellang=en_au
complete+=k
set spell

If I enable spelling, with the options set above, I can't type: ta"ing

Instead what happens is I type ta"in and then for some reason (the message at the bottom says "Back at the original") the cursor jumps back to ta|"in then I press g. So I end up with tag"in

Also, if I have the following text:

some "Ta"ing occurs and then it's the same thing over and over. My name is water

If I try to backspace in insert mode from water, once water is deleted the cursor will jump back to "Ta"ing|

I guess this is actually some sort of vim behavior I am triggering?

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 12 2016 18:25:27)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-2
Compiled by mool@tororo
Huge version with GUI.  Features included (+) or not (-):
+acl                +clipboard          +dialog_con_gui     +farsi              +job                -lua                +num64              +python3/dyn        -sun_workshop       +timers             +wildignore
+arabic             +cmdline_compl      +diff               +file_in_path       +jumplist           +menu               +ole                +quickfix           +syntax             +title              +wildmenu
+autocmd            +cmdline_hist       +digraphs           +find_in_path       +keymap             +mksession          +packages           +reltime            +tag_binary         +toolbar            +windows
+balloon_eval       +cmdline_info       +directx            +float              +lambda             +modify_fname       +path_extra         +rightleft          +tag_old_static     +user_commands      +writebackup
+browse             +comments           -dnd                +folding            +langmap            +mouse              +perl/dyn           +ruby/dyn           -tag_any_white      +vertsplit          -xfontset
++builtin_terms     +conceal            -ebcdic             -footer             +libcall            +mouseshape         +persistent_undo    +scrollbind         +tcl/dyn            +virtualedit        -xim
+byte_offset        +cryptv             +emacs_tags         +gettext/dyn        +linebreak          +multi_byte_ime/dyn -postscript         +signs              -termguicolors      +visual             +xpm_w32
+channel            +cscope             +eval               -hangul_input       +lispindent         +multi_lang         +printer            +smartindent        -tgetent            +visualextra        -xterm_save
+cindent            +cursorbind         +ex_extra           +iconv/dyn          +listcmds           -mzscheme           +profile            +startuptime        -termresponse       +viminfo            
+clientserver       +cursorshape        +extra_search       +insert_expand      +localmap           +netbeans_intg      +python/dyn         +statusline         +textobjects        +vreplace           
   system vimrc file: "$VIM\vimrc"
     user vimrc file: "$HOME\_vimrc"
 2nd user vimrc file: "$HOME\vimfiles\vimrc"
 3rd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
  2nd user exrc file: "$VIM\_exrc"
  system gvimrc file: "$VIM\gvimrc"
    user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
3rd user gvimrc file: "$VIM\_gvimrc"
       defaults file: "$VIMRUNTIME\defaults.vim"
    system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32  -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_JOB_CHANNEL   -DFEAT_XPM_W32   -DWINVER=0x0501 -D_WIN32_WINNT=0x0501  /Fo.\ObjGXOLYHTRi386/ /Ox /GL -DNDEBUG  /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_GUI_W32 -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86.dll\" -DDYNAMIC_TCL_VER=\"8.6\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python35.dll\" -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl524.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=22 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby220.dll\" -DFEAT_HUGE /Fd.\ObjGXOLYHTRi386/ /Zi
Linking: link /RELEASE /nologo /subsystem:windows /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib  comdlg32.lib ole32.lib uuid.lib /machine:i386 gdi32.lib version.lib   winspool.lib comctl32.lib advapi32.lib shell32.lib  /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib user32.lib     /nodefaultlib:python27.lib /nodefaultlib:python35.lib   "E:\tcl\lib\tclstub86.lib" WSock32.lib xpm\x86\lib\libXpm.lib /PDB:gvim.pdb -debug

completion entries skipped if 'c-n' before 'omni'

Under Vim 8.45, set

let g:mucomplete#chains = {
                  \ 'default':  ['c-n', 'omni']
                  \ }
set spell spelllang=en 
set complete=k
set completeopt=menu,menuone

set omnifunc=syntaxcomplete#Complete

and hit after �cras in a file of type text.
Expected: the c-n completion menu for cras appears.
Result: cras is completed to the first option of the c-n completion menu.

This does not happen

  • either with omnifunc=,
  • or if omni comes before c-n.

UltiSnips support

Problems summary

UltiSnips's ForwardTrigger and BackwardTrigger not working

Environment Information

  • OS: OSX 10.11.6
  • Vim version: 8.0.46 (MacVim)

Provide a minimal .vimrc with less than 50 lines (Required!)

set nocompatible
filetype off

execute 'source ~/.vim/bundle/vim-plug/plug.vim'
call plug#begin('~/.vim/bundle/')

Plug 'junegunn/vim-plug'

" Put your bundle below here
Plug 'lifepillar/vim-mucomplete'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
" Put your bundle above here

call plug#end()

syntax on
filetype plugin indent on

" Put your plugin settings below here
let g:mucomplete#enable_auto_at_startup = 1

let g:UltiSnipsUsePythonVersion = 2
let g:UltiSnipsExpandTrigger="<C-J>"
let g:UltiSnipsJumpForwardTrigger="<C-J>"
let g:UltiSnipsJumpBackwardTrigger="<C-K>"
" Put _our plugin settings above here

The reproduce ways from Vim starting (Required!)

  1. :e test.php or set ft=php
  2. type foreach the popup menu will show up, choose it and hit <C-J> to expand it, then you can't not use <C-J> to jump next position

Screen shot (if possible)

mucomplete

Add MUcompleteAutoToggle

Would it be possible to add a toggle for the MUcompleteAuto command? It's quite convenient and user-friendly :)

flicker when case is different

  • Output of echo g:mucomplete#chains: {'vim': ['file', 'cmd', 'keyn'], 'default': ['file', 'omni', 'keyn', 'dict']}
  • Output of setl completeopt: completeopt=menuone,noselect
  • MUcomplete settings in my .vimrc, if any: enable at startup one

I also have set noinfercase.

When I type in a different case then the completion option, the completion popup begins to flicker and sometimes between the flickers I cannot press <C-N> to cycle anymore because it is flickering.

Watch: https://asciinema.org/a/dwx7i36veux6j7dfm055so2b4

Golang support

Hey, how do i enable golang support for mucomplete? I just get completions for word i already used.

Allow the user to choose the complete sequence of keys to exit Ctrl-X submode

Hello,

Currently, by default, the plugin relies on the key sequence C-x C-b BS to exit the CTRL-X submode.
I can't use it because I want to use the same key binding, C-b, to move the cursor backward in insert mode inside Vim, as the one I use inside the shell, or any program using the readline library.

Fortunately, the plugin also allows the user to choose a different key sequence thanks to the global variable g:mucomplete#exit_ctrlx_keys. However, it's only used as a suffix to <C-x>. I may have missed some, but the only other working key sequences beginning with C-x seem to be C-x C-g BS and C-x C-z BS.

So, one could probably write inside their vimrc:

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

Or:

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

The problem is I use the unicode.vim plugin, which installs mapping using the key sequences C-x C-g and C-x C-z.

I found another working key sequence C-g C-g. Besides, it fits the Vim idiom which puts various insert mode mappings behind the C-g prefix. And it's not used, which is confirmed by hitting :h i_^g then C-d, or by looking at the output of :echo map(taglist('^i_CTRL-G'), 'v:val.name').

I'm not asking to change the default value of C-x C-b BS. I know you don't want to, and I understand the reasoning. The help explicitly tells us that C-b is not mapped to anything in insert mode (as explained in :h i_^b). This makes C-b the perfect candidate for the trick which is needed by the plugin, and to make sure we are out of the CTRL-X submode before hitting the completion mapping of any given method.

What I'm asking is a way to use any exit key sequence, including ones which don't begin with C-x. Currently it's not possible because of this line:

let s:cnp = "\<c-x>" . get(g:, 'mucomplete#exit_ctrlx_keys', "\<c-b>\<bs>")

Would it be possible to let the user choose the whole key sequence, and not just the suffix?

Besides, if the user already mapped something to C-b in insert mode, what do you think about recommending them some alternative choices in the help?

Finally, what do you think about adding a warning message, in case the user already mapped something to C-b or C-x C-b. Maybe something like:

if !empty(mapcheck("\<c-x>\<c-b>", 'i')) || !empty(mapcheck("\<c-b>", 'i'))
    echohl WarningMsg
    let msg = "Warning: you have a mapping whose {lhs} is / begins with C-x C-b or C-b\n\n".
            \ "MUcomplete hits those keys before hitting the keys of some methods.\n".
            \ "It does this to make sure you are out of C-x submode before trying them.\n\n".
            \ "Your current mapping could lead to some unexpected behavior.\n".
            \ "Please remove/change it.".
            \ execute('verb imap <c-x><c-b>')."\n".
            \ execute('verb imap <c-b>')."\n\n"
    echo msg
    echohl None
endif

It's just a sketch, I'm sure you would find a better way to formulate the message. I could also try and submit a PR if you want. It uses execute() which would need to be replaced with :redir. Here, it's used to display the output of:

verb imap <c-x><c-b>
verb imap <c-b>

The :verbose modifier command would allow the user to see from which file the mapping was installed, which can help in case they have a lot of plugins and don't know which one is involved.
From there, they could decide if they want/can disable the mapping to avoid any unexpected behavior from mucomplete, or keep it and change the value of g:mucomple#exit_ctrlx_keys.

Without a warning message, a user which doesn't read the documentation, and already mapped something to C-b, could get the wrong impression that the plugin doesn't work properly.

Thanks in advance for your help!

Cycle from bottom to top

Hi!

I'm very sorry if there's a setting that already does that, but I haven't seen it in the docs (which are very good, I must say), and everything I've tried hasn't worked. I would love to cycle from bottom to top (tab goes up, while shift-tab goes down). The issue with the following mappings is that when not in complete mode, pressing tab will decrease the indent level, while s-tab while increase it, which is not what I'm looking for.

imap <tab> <plug>(MUcompleteBwd)
imap <s-tab> <plug>(MUcompleteFwd)

Is there any way I can do this? Thank you :)

Complete after '.' and also add closing parenthesis

For bug reports only, please provide the following details:

  • [I think] I have followed the instructions in :help mucomplete-troubleshooting.
  • Output of echo g:mucomplete#chains: {'vim': ['file', 'cmd', 'keyn'], 'default': ['file', 'omni', 'keyn', 'dict']}
  • Output of setl completeopt: completeopt=menu,longest,menu,menuone,noinsert,noselect
  • MUcomplete settings in my .vimrc, if any:
set shortmess+=c                                       
set completeopt-=preview
set completeopt+=longest,menu,menuone,noinsert,noselect
let g:mucomplete#enable_auto_at_startup = 1

I have a couple of issues:

  • I don't get an auto-popup until I type the second letter of a word, I would prefer to get a popup immediately after the first letter and also immediately after the . notation used for accessing objects. Is this possible to configure? Here is a gif: https://i.imgur.com/hXrZ1eY.gif (the first time I don't press tab and have to type two letters before the popup shows, the second time I just press tab after the . and it loads fine)

  • I like that it inserts a parenthesis, but is there a way to make it insert a closing parenthesis and place your cursor in between them? Or a way to turn off the behavior of inserting a parenthesis?

I only tested it with golang and vim-go

Paste mode

  • I have followed the instructions in :help mucomplete-troubleshooting.
  • Output of echo g:mucomplete#chains: {'default': ['file', 'omni', 'keyn', 'dict']}
  • Output of setl completeopt: completeopt=menu,preview,menu,menuone,noinsert
  • MUcomplete settings in my .vimrc, if any: let g:mucomplete#enable_auto_at_startup = 1

asciicast

Is it possible to disable completion in paste mode? Check the gif to see what happens, basically it inserts 3 sd<Plug>(MUcompleteFwd)gv<Plug>(MUcompleteFwd)0 when I type.

MuComplete not respecting default completeopt arguments behavior

When i open vim with vim -u NONE -N myfile and set completeopt=menuone, vim selects and insert the last completion option.
I don't like this behavior, so i use set completeopt=menuone,noinsert,noselect, which makes vim present all options but not inserting nor selecting any.
However, MuComplete somehow makes it behave backwards, when i have set completeopt=menuone it doesn't insert nor select, and when i have set completeopt=menuone,noinsert,noselect, it does insert and select some option.

Plugin Conflict with Matchem [GIF inside]

I'm getting some very annoying functionality when inserting strings.
So far I've only noticed this happening in vim filetypes but can't exclude it from others.

Here's a small GIF what happens.
screen capture on 2017-01-18 at 17-00-20

I'm not tabbing, it just auto-closes on the 'fi' suggestion.
Now I'm not sure if this is matchem or mucomplete misbehaving but I figured I'd at least start here.

Following the troubleshooting steps, you can recreate this bug with this small vimrc

set runtimepath+=$HOME/.vim/bundle/vim-mucomplete/
set runtimepath+=$HOME/.vim/bundle/matchem/
set completeopt=menuone,noinsert,noselect
set showmode shortmess-=c
let g:mucomplete#enable_auto_at_startup = 1

set ft=vim

2 Characters deleted on CR

For bug reports only, please provide the following details:

  • I have followed the instructions in :help mucomplete-troubleshooting.
  • Output of echo g:mucomplete#chains: let g:mucomplete#chains = { 'default' : ['keyp', 'keyn'] }
  • Output of setl completeopt: menu,preview,noinsert,noselect,menu,menuone
  • MUcomplete settings in my .vimrc, if any:
" µcomplete
set completeopt+=noinsert,noselect
let g:mucomplete#enable_auto_at_startup = 1
inoremap <expr> <c-e> mucomplete#popup_exit("\<c-e>")
inoremap <expr> <c-y> mucomplete#popup_exit("\<c-y>")
inoremap <expr>  <cr> mucomplete#popup_exit("\<cr>")
set completeopt+=menu,menuone
set shortmess+=c
let g:mucomplete#spel#good_words = 1
let g:mucomplete#spel#max = 10
let g:mucomplete#chains = { 'default' : ['keyp', 'keyn'] }
fun! s:toggle_completeopt()
  if exists('#MUcompleteAuto')
    setlocal completeopt+=noinsert,noselect
  else
   setlocal completeopt-=noinsert,noselect
  endif
endf
nnoremap <silent> <leader>u :<c-u>MUcompleteAutoToggle<CR>:call <sid>toggle_completeopt()<CR>   " Toggle AutoCompletion

With the above settings, I have issues with a new blank vim document if I type:

Port<cr>
Port<cr>

The second (and later lines) when I press return on the end of Port, it deletes 2 characters so I end up with

Po

If I comment out "let g:mucomplete#chains = { 'default' : ['keyp', 'keyn'] }" the issue goes away.
If I turne off Autocomplete it also goes away.

Not sure what other debugging I can offer sorry, please let me know.

Using `CompleteDone` event for chained completion

Hi @lifepillar,

While having a discussion on r/vim, I got an idea regarding chained-completion.
I was wondering whether the dictionary v:completed_item (populated by the CompleteDone event) can be used to check whether a previous completion failed. If this can be done, we can even get rid of the requirement to set menuone in completeopt.
However, I am not sure whether it's feasible. What do you think? Should I try and submit a PR if it works?

Edit: corrected the name of the variable.

Snipmate compatibility

For bug reports only, please provide the following details:

  • I have followed the instructions in :help mucomplete-troubleshooting.
  • Output of echo g:mucomplete#chains: {'default': ['file', 'omni', 'keyn', 'dict']}
  • Output of setl completeopt: completeopt=menu,preview,menu,menuone,noinsert
  • MUcomplete settings in my .vimrc, if any: let g:mucomplete#enable_auto_at_startup = 1

First of all, thanks for trying to make vim completion simple and great again.

I want to avoid all those plugins that are not made with vimL, just because they're often a pain to install on a new computer. This is why I prefered SnipMate over UltiSnips (python). The thing is, I can't trigger the snippets, and though you may have a solution.

I don't use any snipmate configuration, I just have the following (using Vundle):

Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets'

Should I do something in particular do add the snipmate support? Thanks!

Feature Request - Ability to set completeopt on MU Auto Toggle

It would be nice (I think, there are probably good reasons it's not) to have completeopt's settings be toggled for you when MUcompleteAutoOff/On/Toggle is used.

For example (this is bad pseudo code)

let g:mucomplete#CompAutoOn = {add : 'noinsert, noselect'}
let g:mucomplete#CompAutoOff = {remove: 'noinsert,noselect'}

Does this make sense? Is it a good idea, or a stupid one?

ultisnips: "E33: No previous substitute regular expression" after ~

  • I have followed the instructions in :help mucomplete-troubleshooting.
  • Output of echo g:mucomplete#chains: {'default': ['file', 'omni', 'ulti', 'keyn', 'dict']}
  • Output of setl completeopt: menu,menuone,noinsert
  • MUcomplete settings in my .vimrc, if any:
let g:mucomplete#enable_auto_at_startup = 1
let g:mucomplete#auto_select = 0
let g:mucomplete#chains = {}
let g:mucomplete#chains.default = ['file','omni','ulti', 'keyn','dict']

It seems that if I use ~ in the pathname I got the error from the title.

~<Tab>
or
~/xy

leads to:

Error detected while processing function mucomplete#ultisnips#complete:
line    5:
E33: No previous substitute regular expression

Fuzzy completion?

This is maybe out-of-scope and/or not feasible for vim-mucomplete, but I'm gonna ask anyway. Would it be possible to do fuzzy matching like YCM?

'spel' precedes 'keyn' even if listed last in g:mucomplete#chains

Under Vim 8.45, if

let g:mucomplete#chains = {
      \ 'default':  ['keyn, 'spel']
      \ }

and set spell spelllang=en and set complete=k, then hit <tab> after cras.

Expected: the menu keyword completion menu appears.
What happens: the spell correction completion menu appears.

b:mucomplete_chains

Define a b:mucomplete_chains variable so that for example an autocommand can add spel completion if and only if &l:spell is set.

Thanks for this great plug-in!

`cmd` method should be handled differently

Hello,

If I write this in /tmp/vimrc.vim:

set cot=menu,menuone
set rtp+=~/.vim/plugged/vim-mucomplete/

let g:mucomplete#chains = {}
let g:mucomplete#chains.default = ['cmd', 'keyn']

" foobar
" foo

And if I start Vim like this:

vim -Nu /tmp/vimrc.vim /tmp/vimrc.vim

I position the cursor after the last foo and hit Tab: the text is not completed into foobar like I expected.
If I replace the cmd method with another method, which is also unable to complete foo, like omni:

 let g:mucomplete#chains.default = ['omni', 'keyn']

This time, foo is completed into foobar.

It seems the cmd method is special, because when it fails the result of the next keys is inconsistent.
On my system, if I insert foo, hit C-x C-v, then C-x C-n or C-x C-p, I expect C-x C-v to fail, then C-x C-n to complete the text by looking at the other keywords in the current file. That's not what Vim does. It just seems to retry C-x C-v.

For all the other standard completion mappings, C-x C-d, C-x C-o, C-x C-t …, the first C-x seems to make us leave the CTRL-X sub-mode, and then the next key (C-d, C-o, C-t, …) is interpreted as if we were in insert mode.

See what happens with the following chain ['cmd', 'defs', 'keyp']:
http://imgur.com/a/iwqvK

The text is:

" foobar
    " foo

After hitting Tab, the result is:

" foobar
" foobar

The keyp method was correctly applied, but the indentation of the line was changed, which was unexpected. The cause is, again, the cmd method. After it failed, the defs method was tried. C-x C-d was hit. C-x made us leave CTRL-X sub-mode, and C-d deleted one level of shiftwidth at the start of the line.

The interaction with the plugin is even weirder. Consider this chain ['cmd', 'omni', 'keyp'] and this text:

" foobar
" foo| 3

The pipe represents the cursor. Hit Tab. What should happen? Without the plugin, here's the result you get:

" foobar
" foo foo2

The C-o from C-x C-o is interpreted as entering the normal sub-mode (described in :h i^o). And the C-x from the next C-x C-p is interpreted as the normal decrement command (:h ^x).
Finally, the last C-p inserts the previous word which here is foo.

Here's a gif showing the whole sequence: http://imgur.com/a/2KikK

But that's not what the plugin does, it just seems to stop at the first failing method cmd:
http://imgur.com/a/cG4Oy

I don't understand. But it seems the only solution to make the cmd method work reliably would be to prefix all the methods with the keys stored in s:cnp. I don't know if it's worth the trouble, because, when autocompletion is enabled, it means at least 2 additional keys to hit for each method to try, after each character inserted.

Another alternative would be to remove the method entirely from the plugin to avoid future bug reports.

Repeated directory-name in 'file' completion mode

Thanks for the awesome plugin.

My completion-chain is the following:

let g:mucomplete#chains = {}
let g:mucompletechains.default = ['file', 'c-p']

The problem is that while completing paths, upon pressing tab, I get the next portion of the directory-name written twice into the buffer.
Thus, for the path /home/manas, if I type /ho<tab>, it expands to home/home. Then I need to delete the second home. Once I write /home/ma<tab>, it expands to /home/manas/manas, and so on. Note that things are okay if I don't type anything after / and press tab.

This works perfectly fine with the default <C-X><C-F> file completion of Vim.

p.s. path completion provided by vim-mucomplete is not what I want.

Clang library path on linux

Hi,

I am new to C++ and Vim. I am using Ubuntu 16.04 and have gcc and clang installed.

$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ clang --version
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

My problem is, I cannot find libclang.dylib file on my system. Some google search shows that this file is specific to Mac OS and does not exist on linux. If that's the case which file I can use for clang_library_path?

Thanks,

Incompatability with vim-peekaboo

Hi,
When using junegunn/vim-peekaboo with the following settings, µcomplete breaks when I type a third letter, I end up with 3 letters on the screen, the vim jumps into normal mode and starts entering what I typed, then if I hit esc I often end up with "pumvisible()?mucomplete#yup():'' written in my buffer.

My settings:
" µcomplete
let g:mucomplete#enable_auto_at_startup = 1
setl dictionary=/usr/share/dict/british-english-huge

Note that vim-peekaboo has a section about how it has a known issue with macros. But I don't understand vimscript at all to know if it's something that can be fixed, or if I need to give up using peekaboo.

As soon as I disable vim-peekaboo µcomplete works as expected.

Thanks!

Completion not triggered even when a list is returned

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.

<C-h> issue

Hi,

I was hunting down an issue, where when I press my backspace the popup menu would start to change and wouldn't delete the chars at all even sometimes completed the previously inserted word..
I figured out that there are some cases in some terminals that backspace is sent as <C-h> which I guess you know the behavior of that.

This is just an heads up since I figured my issue, and to avoid any further issues

http://stackoverflow.com/questions/18777705/vim-whats-the-default-backspace-behavior

The answer explains the specific backspace option on certain terminals.

you might want to rebind that <C-h> or having some global option to do so

Thanks.

'c-n' or 'c-p' in g:mucomplete#chains causes a newline

For bug reports only, please provide the following details:

  • I have followed the instructions in :help mucomplete-troubleshooting.
  • Output of echo g:mucomplete#chains:
    {'vim': ['path', 'cmd', 'c-n'], 'default': ['path', 'omni', 'user', 'c-n', 'dict']}
  • Output of setl completeopt:
    completeopt=menu,preview,menuone,noinsert,noselect
  • MUcomplete settings in my .vimrc, if any:
    let g:mucomplete#chains = {'vim': ['path', 'cmd', 'c-n'], 'default': ['path', 'omni', 'user', 'c-n', 'dict']}

If your problem has to do with specific completion methods, please provide the
output of the relevant settings (choose all that apply):

  • ('c-n', 'c-p', 'line') setl ft cpt inc pa dict tsr spell? spl tags
    and echo tagfiles()
    setl output:
  complete=.,w,b,u,kspell
  include=
  path=
  dictionary=
  thesaurus=
  spell
  spelllang=nl,en,de,es
  tags=

echo tagfiles(): []

Using 'c-n' or 'c-p' produces a newline before every suggestion as soon as I type to call mucomplete. I need one of those chains because otherwise keywords from other buffers are not included. If there's another option to achieve that I'll drop 'c-n' in a second since it causes quite some lag ;-)

Ultisnip completion method - add to chain

It would be super cool if we had a Ultisnip completion method to add to our chain. I have so many snippets created for different cases with a little comment added to the snippets and i got so lazy using YCM and such where i could cycle through the possible snippets that i would really love this kind of feature, if possible.

Comparison of vim completers

Obviously this is outside the scope of this project, but I'm wondering if you could help me identify the differences between this plugin and some of the currently more popular auto-complete plugins.

YouCompleteMe, NeoComplete, Deoplete, VimCompletesMe, NeoComplCache, and AutoComplPop.

Are there features that you had to sacrifice to keep the completion simple / minimal that the others might be better for?

Thanks - and great job on the plugin!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.