|
|
(16 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| coc.nvim aims to be intellisense (visualstudio) for vim. | | coc.nvim aims to be intellisense for vim. It provides: |
| | |
| * autocompletion | | * autocompletion |
| * outliner | | * outliner |
Line 6: |
Line 5: |
| * goto | | * goto |
| * show-references | | * show-references |
|
| |
| {{ WARNING |
| |
| coc.nvim '''DOES NOT''' play nice with other autocompleters. }}
| |
|
| |
|
|
| |
|
Line 38: |
Line 34: |
| </blockquote><!-- Locations --> | | </blockquote><!-- Locations --> |
|
| |
|
| = Languages = | | = Notes = |
| <blockquote> | | <blockquote> |
| Languages can be installed dynamically with <code>:CocInstall coc-python</code><br>
| | {| |
| or automatically like <code>Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'}</code>.
| |
| | |
| {| class="wikitable" | |
| |- | | |- |
| | python || unmaintained || [[coc-python]]
| | | [[coc.nvim install]] |
| |- | | |- |
| | python || active || [[coc-pyright]]
| | | [[coc.nvim language servers]] |
| |- | | |- |
| | sh/bash || active || [[coc-sh]]
| | | [[coc.nvim configuration]] |
| |- | | |- |
| | ruby/rails || active || [[coc-solargraph]]
| | | [[coc.nvim usage]] |
| |- | | |- |
| | graphql || active || [[coc-graphql]]
| | | [[coc.nvim troubleshooting]] |
| |- | | |- |
| |} | | |} |
| </blockquote><!-- languages --> | | </blockquote><!-- Notes --> |
| | |
| = Install =
| |
| <blockquote>
| |
| <syntaxhighlight lang="vim">
| |
| # archlinux
| |
| sudo pacman -S \
| |
| nodejs \
| |
| npm
| |
| | |
| # macos
| |
| brew install
| |
| node.js \
| |
| npm
| |
| | |
| npm install -g neovim
| |
| </syntaxhighlight>
| |
| | |
| <syntaxhighlight lang="vim">
| |
| " install coc
| |
| Plug "https://github.com/neoclide/coc.nvim", {'branch': 'release'}
| |
| | |
| " install coc languages
| |
| Plug 'https://github.com/neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'}
| |
| CocInstall coc-pyright
| |
| </syntaxhighlight>
| |
| | |
| {{ NOTE |
| |
| Officially, installing servers can be done from vim-plug, but I have not had success with this.
| |
| | |
| <code>CocInstall</code> works every time. It's probably best to check files on disk.
| |
| }}
| |
| </blockquote><!-- Install -->
| |
| | |
| = Configuration =
| |
| <blockquote>
| |
| == Keybindings ==
| |
| <blockquote>
| |
| coc.nvim does not provide function calls, they direct you to bind hotkeys instead.
| |
| <syntaxhighlight lang="vim">
| |
| 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)
| |
| </syntaxhighlight>
| |
| </blockquote><!-- keybindings -->
| |
| </blockquote><!-- Configuration -->
| |
| | |
| = Usage =
| |
| <blockquote>
| |
| <syntaxhighlight lang="vim">
| |
| CocInstall coc-python " install a language
| |
| | |
| CocShowDefinition " show docs
| |
| CocOpenLog " show log
| |
| CocOutline " outliner of all symbols
| |
| </syntaxhighlight>
| |
| </blockquote><!-- Usage -->
| |
| | |
| = Troubleshooting =
| |
| <blockquote>
| |
| <source lang="vim">
| |
| :CocInfo " print debug info
| |
| </source>
| |
| </blockquote><!-- troubleshooting -->
| |