Using YouCompleteMe

YouCompleteMe doesn't introduce a lot of new key bindings, which makes integrating it into your workflow easier. Enter insert mode and start typing away:

As you do, autocomplete suggestions will pop up. The Tab key will cycle through suggestions. Furthermore, if YouCompleteMe is able to look up function definition, together with a supporting docstring, it will show up in a preview window at the top of the screen:

The preview window only shows up when YouCompleteMe uses the semantic autocomplete engine. The semantic engine is automatically invoked after typing . (period) in insert mode or manually by pressing Ctrl + spacebar.

For Python, YouCompleteMe also allows you to jump to function definition. Add the following mapping to your .vimrc file:

noremap <leader>] :YcmCompleter GoTo<cr>

Now, with the cursor over a function call, press your leader key (backslash () by default), followed by ]. You will be taken to the function definition:

YouCompleteMe is not the only available autocomplete tool, but merely the author's favorite (and the most popular option at the time of writing this book). There are many alternatives. A quick search along the lines of Vim autocomplete will yield plenty of results if you're interested in an alternative.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.131.168