Coc.nvim usage

From wikinotes

Builtin Commands

CocInstall   coc-pyright  " install a language
CocUninstall coc-pyright  " uninstall a language

CocOutline                " tagbar-like outliner

CocCommand ${cmd}         " run command provided by LSPs
CocList commands          " fuzzy search commands provided by LSPs

Most COC functionality is exposed as Actions.

" call action synchronously
call CocAction('definitionHover')

" call action asynchronously (with optional callback)
function! s:DoAfterHover()
    echom 'hihihi'
endfunc
call CocActionAsync('definitionHover', function('s:DoAfterHover'))

Derived Commands

You can also bind commands mirroring the provided plug functions.

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

" Introspection (src, packages)
CocDefinition          " go to where variable assigned
CocTypeDefinition      " go to where variable type defined
CocImplementation
CocReferences          " show uses of variable
CocShowdocumentation   " show docs

" Formatting
CocFormatBuffer        " format file
CocFormatSelected      " format selection
CocOrganizeImports    " sort imports

" Debugging
CocInfo                " show nvim, coc, lsp info
CocOpenLog             " show log