coc.nvim: mention LSP-Extensions.md and coc-snippets

Fangrui Song 2019-10-02 20:19:01 -07:00
parent 7059a9bed2
commit 085ff9bad3

@ -8,7 +8,7 @@ Open config file with command `:CocConfig`
"ccls": {
"command": "ccls",
"filetypes": ["c", "cpp", "cuda", "objc", "objcpp"],
"rootPatterns": [".ccls", "compile_commands.json", ".vim/", ".git/", ".hg/"],
"rootPatterns": [".ccls-root", "compile_commands.json"],
"initializationOptions": {
"cache": {
"directory": ".ccls-cache"
@ -48,24 +48,16 @@ au CursorHold * sil call CocActionAsync('highlight')
au CursorHoldI * sil call CocActionAsync('showSignatureHelp')
```
### `$ccls/navigate`
### Completion
Semantic navigation. Roughly,
Install [coc-snippets](https://github.com/neoclide/coc-snippets) to enable LSP snippets.
"D" => first child declaration
"L" => previous declaration
"R" => next declaration
"U" => parent declaration
```vim
nn <silent><buffer> <C-l> :call CocLocations('ccls','$ccls/navigate',{'direction':'D'})<cr>
nn <silent><buffer> <C-k> :call CocLocations('ccls','$ccls/navigate',{'direction':'L'})<cr>
nn <silent><buffer> <C-j> :call CocLocations('ccls','$ccls/navigate',{'direction':'R'})<cr>
nn <silent><buffer> <C-h> :call CocLocations('ccls','$ccls/navigate',{'direction':'U'})<cr>
```
See [[client.snippetSupport and completion.placeholder|Customization#clientsnippetsupport]] for customization of snippet expansion.
### Cross reference extensions
See [[LSP Extensions]] for the description of these extensions.
```vim
" bases
nn <silent> xb :call CocLocations('ccls','$ccls/inheritance')<cr>
@ -94,4 +86,15 @@ nn <silent> xv :call CocLocations('ccls','$ccls/vars')<cr>
nn <silent> xV :call CocLocations('ccls','$ccls/vars',{'kind':1})<cr>
nn xx x
```
```
### `$ccls/navigate`
See [[$ccls/navigate|LSP-Extensions#cclsnavigate]]
```vim
nn <silent><buffer> <C-l> :call CocLocations('ccls','$ccls/navigate',{'direction':'D'})<cr>
nn <silent><buffer> <C-k> :call CocLocations('ccls','$ccls/navigate',{'direction':'L'})<cr>
nn <silent><buffer> <C-j> :call CocLocations('ccls','$ccls/navigate',{'direction':'R'})<cr>
nn <silent><buffer> <C-h> :call CocLocations('ccls','$ccls/navigate',{'direction':'U'})<cr>
```