You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin allows vim to use Racer for Rust code completion and navigation.
Note: Active development on vim-racer has stopped. The only future changes
will be bug fixes. You should use LSP plugins(vim-lsp, nvim-lspconfig)
instead.
Add g:racer_cmd to your .vimrc. It contains full path to racer
executable file. Variable g:racer_cmd is optional. You do not need to use
this variable if the executable file is in a directory that is specified in
$PATH, else you should specified full path to racer executable binary
file in this g:racer_cmd. Also it's worth turning on 'hidden' mode for
buffers otherwise you need to save the current buffer every time you do a
goto-definition. E.g.:
set hidden
let g:racer_cmd = "/home/user/.cargo/bin/racer"
If you want completions to show the complete function definition (e.g. its
arguments and return type), enable the experimental completer:
let g:racer_experimental_completer = 1
If you want to insert the parenthesis in the completion:
let g:racer_insert_paren = 1
Example Mappings
vim-racer enables C-x-C-o to search for completions and provides several
<Plug> mappings for source code navigation. These mappings are not enabled by
default but you can easily use them by adding the following lines to your
.vimrc (Or init.vim in case of Neovim).
For example, with the following mappings you can navigate to the identifier
under the cursor and open it on the current buffer, on an horizontal or
vertical split, on a new tab, or go straight to the documentation: