Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

conflict with YouCompleteMe #65

Open
gergap opened this issue Aug 10, 2015 · 5 comments
Open

conflict with YouCompleteMe #65

gergap opened this issue Aug 10, 2015 · 5 comments

Comments

@gergap
Copy link

gergap commented Aug 10, 2015

Hi

1st conflict: Returning to normal mode when YCM popup is shown and ESC is pressed.
This can be fixed by adding
let g:AutoClosePumvisible = {"ENTER": "", "ESC": ""}
to .vimrc as described here: ycm-core/YouCompleteMe#9

2nd conflict: When in insert mode and pressing Cursor Up/Down it inserts some text like "pumvisible() ? ...".
I could fix this here by uncommenting the "inoremaps" in line 471 and 473:

            if len(l:pvisiblemap)
                "exec "inoremap <buffer> <silent> <expr> " . key . " pumvisible() ? '" . l:pvisiblemap . "' : '<C-R>=<SID>FlushBuffer()<CR>" . l:currentmap . "'"
            else
                "exec "inoremap <buffer> <silent> " . key . "  <C-R>=<SID>FlushBuffer()<CR>" . l:currentmap
            endif

I don't know what this was for and what sideeffects it has to remove these mappings. Anyway, it works for me now. Maybe you can fix this upstream, so that your plugin works together with YouCompleteMe.

regards,
Gerhard.

@Mule52
Copy link

Mule52 commented Dec 30, 2015

I am running into this exact same problem. When using AutoClose in vim insert mode, I create a JavaScript function and add my first "{" and AutoClose adds the second one "}" to match it. I then hit my enter key to give my function a new line, then I click on my up arrow to return to where I want to type my text, once I click that up arrow, I get all that pumvisible() text inserted into my file.

Is there a way to ignore the mapping of and for AutoClose? I am not sure what else to do.

Thanks.

@IlikePepsi
Copy link

I had the same issue with some strange text inserted hitting the arrow keys. Also after installation of YouCompleteMe. For me replacing all the imap with inoremap statements in /plugin/AutoClose.vim line 29-36 seems to fix the issue.

Kind regards.

@fatso83
Copy link

fatso83 commented Jun 8, 2017

The official tips from YCM is to just use Raimondi/delimitMate

Alternatively let g:AutoClosePumvisible = {"ENTER": "", "ESC": ""}
ref

@MuhammetFevziBayiroglu
Copy link

MuhammetFevziBayiroglu commented Oct 14, 2017

llikePepsi I had the same issue but it only started after I installed nerdtree and opened a second file from the tree, opening it in a new tab. Every time I pressed the up or down key in insert mode it would insert weird text like
"
Pumvisible() ...
It looked like it was from one of the plugins .vim files. And thanks a lot for sharing your fix, spent half the day trying to fix it, couldn't find it anywhere on the internet.

@ghost
Copy link

ghost commented Dec 20, 2018

@gergap @Mule52 @IlikePepsi @fatso83 @MuhammetFevziBayiroglu I have forked the project and made a number of modifications that will improve compatibility with autocompletion plugins like YouCompleteMe. Maybe my modifications can help improve your experience with AutoClose. You can find the project at: https://github.com/whitehatzero/vim-autoclose

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants