all. I am trying to use youcompleteme for code completing in vim. Generally, it works well except that when i need to jump between source files. First. I use the subcommand
:YcmCompleter GoToDefinition
it can find the definition. BUT it seems so verbose. Then I want to map this subcommand into some shortcut key according to the YCM's instruction:
nnoremap <leader>gl :YcmCompleter GoToDeclaration<CR>
nnoremap <leader>gf :YcmCompleter GoToDefinition<CR>
nnoremap <leader>gg :YcmCompleter GoToDefinitionElseDeclaration<CR>
I am a little confused. what is short cut key? l or gl ?
< Vim. YouCompleteMe (shortened as YCM) is a code-completion engine for Vim. It supports the following languages: C/C++/Objective-C/Objective-C++ Python.
Install the prerequisite Termux packages. Install Vundle by following the official instructions. This includes cloning the repository and editing your vimrc as necessary. Install YouCompleteMe by adding it to the list of plugins in your vimrc file, and then running the :PluginInstall command in vim.
When you create a mapping with <leader>
, <leader>
is replaced by whatever is in your "mapleader" variable (by default \
).
If you have this in your vimrc:
let mapleader=","
nnoremap <leader>gl :YcmCompleter GoToDeclaration<CR>
It acts the same as:
nnoremap ,gl :YcmCompleter GoToDeclaration<CR>
Thus you could run the YcmCompleter GoToDeclaration
command by pressing ,gl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With