Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to accept a suggestion from Vim YouCompleteMe plugin

When there are multiple complete suggestions from Vim plugin YouCompleteMe, how do I accept the one I want ?

What I currently do is pressing Esc key, I just want to know if I got it right.

like image 535
Ask and Learn Avatar asked Nov 07 '13 12:11

Ask and Learn


People also ask

How do I set up YouCompleteMe?

On Windows, be sure that the build utility msbuild is in your PATH. Go support: install Go and add it to your path. Navigate to YouCompleteMe/third_party/ycmd/third_party/gocode and run go build . TypeScript support: as with the quick installation, simply npm install -g typescript after successfully installing Node.


3 Answers

To accept the current insert completion entry use <c-y>. Think of it as "yes".

For more help see:

:h complete_ctrl-y
like image 73
Peter Rincker Avatar answered Oct 02 '22 09:10

Peter Rincker


Usually with Ctrl + Y (yes); read up :help popupmenu-keys.

like image 32
Ingo Karkat Avatar answered Oct 02 '22 09:10

Ingo Karkat


Ctrl-Y is default, but you can add other key bindings by adding this line to your .vimrc:

let g:ycm_key_list_stop_completion = ['<C-y>', '<CR>']

In this ^ example, you can use either Ctrl-Y or Enter to accept the completion and free up the cursor.

like image 28
0x000bff Avatar answered Oct 02 '22 08:10

0x000bff