Lab manual for the Thornton lab at UC Irvine
This document describes how to set up coc-nvim for neovim
or vim
.
For vim
, you need version 8 or later.
coc-vim
is a code-completion and linting system.
It works via a language server model similar to Microsoft’s VScode.
First, install node
and npm
:
sudo apt install nodejs npm
In your init.vim
(or .vimrc
) using vim-plug:
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Then, restart vim
and :PlugInstall
.
For other plugin managers, do what’s needed.
:CocInstall coc-clangd
C and C++ error checking and code completion depends on a file called compile_commands.json
, which is processed by clangd
.
First, make sure clangd
is installed:
sudo apt install clangd
For projects using cmake
:
mkdir ccommands
cd ccommands
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=1
mv compile_commands.json ..
cd ..
rm -rf ccomands
meson
generates the file automatically:
meson build
mv build/compile_commands.json .
If using autotools
:
sudo apt install bear
Then,
bear make
:CocInstall coc-pyright
This section probably needs further updating on configuration. By default, you get a lot of lint issues flagged, some of which are not necessarily anything to worry about.
:CocInstall coc-rls