VimPlugin: Coc.nvim: Difference between revisions
From wikinotes
(→Usage) |
|||
Line 71: | Line 71: | ||
<syntaxhighlight lang="vim"> | <syntaxhighlight lang="vim"> | ||
" install coc | |||
Plug "https://github.com/neoclide/coc.nvim", {'branch': 'release'} | |||
" install coc languages | |||
Plug 'https://github.com/neoclide/coc-pyright', {'do': 'yarn install --frozen-lockfile'} | |||
Plug 'https://github.com/neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'} | |||
Plug 'https://github.com/neoclide/coc-solargraph', {'do': 'yarn install --frozen-lockfile'} | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Install --> | </blockquote><!-- Install --> |
Revision as of 00:40, 27 December 2021
coc.nvim aims to be intellisense (visualstudio) for vim.
- autocompletion
- outliner
- refactor-rename
- goto
- show-references
WARNING:
coc.nvim DOES NOT play nice with other autocompleters.
Documentation
Locations
~/.config/nvim/coc-settings.json
config ~/.config/coc/extensions/node_modules/${plugin}
plugins installed here ~/.config/coc/memos.json
persisted plugin data
Languages
Languages can be installed dynamically with
:CocInstall coc-python
or automatically likePlug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'}
.
python coc-python ruby/rails coc-solargraph graphql coc-graphql
Install
# archlinux sudo pacman -S \ nodejs \ npm # macos brew install node.js \ npm npm install -g neovim" install coc Plug "https://github.com/neoclide/coc.nvim", {'branch': 'release'} " install coc languages Plug 'https://github.com/neoclide/coc-pyright', {'do': 'yarn install --frozen-lockfile'} Plug 'https://github.com/neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'} Plug 'https://github.com/neoclide/coc-solargraph', {'do': 'yarn install --frozen-lockfile'}
Configuration
Keybindings
coc.nvim does not provide function calls, they direct you to bind hotkeys instead.
nmap <silent> gd <Plug>(coc-definition) nmap <silent> gy <Plug>(coc-type-definition) nmap <silent> gi <Plug>(coc-implementation) nmap <silent> gr <Plug>(coc-references)
Usage
CocInstall coc-python " install a language CocShowDefinition " show docs CocOpenLog " show log CocOutline " outliner of all symbols
Troubleshooting
:CocInfo " print debug info