Coc.nvim configuration

From wikinotes

Locations

~/.config/nvim/coc-settings.json coc and extension configuration

coc-settings.json

This file contains configuration for all coc extensions, in addition to coc itself.
It is expressed in JSONc (json + comments).

If you have installed coc-json, the configuration options will be auto-completed!

At any time you can open this with :CocConfig.

.vimrc

Options

" change where coc settings saved to (useful for work-env/os dependent configurations)
let g:coc_config_home = $HOME."/.config/nvim"

" installed extensions
let g:coc_global_extensions = ["coc-json", "coc-git", ...]

Command Interface

Plug Functions

coc.nvim does not provide many commands, they direct you to bind hotkeys to plug-functions 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)

You can create vim commands to mirror these functions though if you'd like

command CocRename silent exec "normal \<Plug>(coc-rename)"

Coc-Commands

It is also good to be aware that extensions may provide their own language-specific commands.
These can be searched, or tab-completed.

:CocList commands              " fuzzy-search commands
:CocCommand solargraph.search  " search sourcecode