Version: 9.1
Dependencies:
- Node.js
- The C/C++ toolchain (make
, gcc
, etc.)
First, we need a plugin manager. I am currently using vim-plug
via the GitHub page.
Once this is installed, download the extensions:
- Dracula Theme
- coc.nvim -
- Extension: coc-rust-analyzer
- ALE
HELP: Once installed, run :help coc-nvim
Assume vim-plug and Node.js are both installed and available.
- specify coc.nvim in your package manager.
Plug 'neoclide/coc.nvim', {'branch': 'release'},
- Install via
:PlugInstall
- Install
coc-rust-analyzer
via:CocInstall coc-rust-analyzer
- Install
coc-json
for Config (addautocmd FileType json syntax match Comment +\/\/.\+$+
to VIMRC to fix comment highlighting) - Source the example configuration in your vimrc or paste it directly.
- Important for Tab completion and other features.
- Add the following to
:CocConfig
to control what is checked by cargo clean.
"workspace.ignoredFolders": [
"$HOME",
"$HOME/.cargo/**",
"$HOME/.rustup/**"
],
For Posterity: the feature where type hints are displayed as virtual text is called inlay hinting. Knowing this saves search time.
Plug 'dense-analysis/ale'
- Configure via
let g:ale_linters={'rust': ['analyzer']}
- Add any additional configuration options as desired.
These plugins work together, we just need to change the configuration.
Coc
- Open the configuration JSON file
:CocConfig
. - Add
"diagnostic.displayByAle": true,
to the file.
ALE
- Add
let g:ale_disable_lsp=1
to the relevant VimScript file (either.vimrc
or a custom file that you source within.vimrc
)