-
-
Notifications
You must be signed in to change notification settings - Fork 954
/
coc.txt
2450 lines (1542 loc) · 64.1 KB
/
coc.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
*coc-nvim.txt* LSP support for vim & neovim.
Version: 0.0.57
Author: Qiming Zhao <chemzqm at gmail.com>
License: MIT license
CONTENTS *coc-contents*
Introduction |coc-introduction|
Requirement |coc-requirement|
Install |coc-install|
Configuration |coc-configuration|
Completion |coc-completion|
LanguageServer |coc-languageserver|
Interface |coc-interface|
Keymappings |coc-key-mappings|
Variables |coc-variables|
Functions |coc-functions|
Commands |coc-commands|
Autocmds |coc-autocmds|
Highlights |coc-highlights|
List |coc-list|
List command |coc-list-command|
List configuration |coc-list-configuration|
List mappings |coc-list-mappings|
List sources |coc-list-sources|
Location |coc-list-location|
Extensions |coc-list-extensions|
Diagnostics |coc-list-diagnostics|
Outline |coc-list-outline|
Symbols |coc-list-symbols|
Services |coc-list-services|
Commands |coc-list-commands|
Links |coc-list-links|
Output |coc-list-output|
Sources |coc-list-completion-sources|
Lists |coc-list-lists|
Statusline support |coc-status|
Manual |coc-status-manual|
Airline |coc-status-airline|
Lightline |coc-status-lightline|
FAQ |coc-faq|
Changelog |coc-changelog|
==============================================================================
INTRODUCTION *coc-introduction*
Coc.nvim is created to make your (neo)vim have more intelligence like VSCode.
It can:~
- Provide APIs that work on both vim8 and neovim.
- Load VSCode like extensions.
- Configure coc.nvim and extensions by use jsonc configuration file.
- Configure language servers that implements LSP.
It's designed to work well with your other vim plugins as much as possible.
Note: unlike some of IDEs, it doesn't hijack your experience, you can turn
off any feature whenever you want.
==============================================================================
REQUIREMENT *coc-requirement*
Note: this plugin requires neovim >= 0.3.0 or vim >= 8.0.
Node: https://nodejs.org/en/download/ is required to run javascript code.
If those requirements are not satisfied, the plugin will not be loaded
at all.
==============================================================================
INSTALL *coc-install*
To use the [vim-plug](https://github.com/junegunn/vim-plug), add this: >
Plug 'neoclide/coc.nvim', {'branch': 'release'}
to your `init.vim` and run: >
:PlugInstall
For other plugin managers, use code from release branch.
Or use vim's buildin package feature like: >
#!/bin/sh
# for vim8
mkdir -p ~/.vim/pack/coc/start
cd ~/.vim/pack/coc/start
curl --fail -L https://github.com/neoclide/coc.nvim/archive/release.tar.gz|tar xzfv -
# for neovim
mkdir -p ~/.local/share/nvim/site/pack/coc/start
cd ~/.local/share/nvim/site/pack/coc/start
curl --fail -L https://github.com/neoclide/coc.nvim/archive/release.tar.gz|tar xzfv -
==============================================================================
CONFIGURATION *coc-configuration*
A JSONC formatted file named `coc-settings.json` is used for configuration.
Use the command |:CocConfig| to open the user configuration file, or create
`.vim/coc-settings.json` in your project root for folder-based configuration.
To enable completion and validation support of the settings file, install the
`coc-json` extension: `:CocInstall coc-json`.
Check out https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file
for more details.
Builtin configurations:~
"http.proxy":~
HTTP proxy URI, used for extensions that send request, default: `""`
"http.proxyStrictSSL":~
default: `true`
"suggest.enablePreselect":~
Enable preselect feature on neovim, default: `true`
"suggest.maxPreviewWidth":~
Maximum width of floating preview window., default: `80`
"suggest.labelMaxLength":~
Maximum length of label shown in pum, default: `200`
"suggest.enablePreview":~
Add preview option to `completeopt`, default: `false`
"suggest.floatEnable"~
Enable floating window for documentation when possible, default: `true`
"suggest.detailMaxLength":~
Max length of detail that should be shown in popup menu., default:
`100`
"suggest.detailField":~
Where to add the detail in complete item when it's less than max
length., default: `"menu"`
Valid options: ["abbr","menu","preview"]
"suggest.autoTrigger":~
How should completion be triggered, default: `"always"`
Valid options: ["always","trigger","none"]
"suggest.languageSourcePriority":~
Priority of language sources., default: `99`
"suggest.numberSelect":~
Input number to select complete item, it could be wrong when
using <up> and <down> to select complete item, default: `false`
"suggest.disableKind":~
Remove kind field from vim complete item., default: `false`
"suggest.disableMenu":~
Remove menu field from vim complete item., default: `false`
"suggest.snippetIndicator":~
The character used in abbr of complete item to indicate the item could
be expand as snippet., default: `"~"`
"suggest.maxCompleteItemCount":~
Maximum number of complete items shown in vim, default: `50`
"suggest.preferCompleteThanJumpPlaceholder":~
Confirm completion instead of jump to next placeholder when completion
is activated., default: `false`
"suggest.fixInsertedWord":~
Make inserted word replace word characters after cursor position.,
default: `true`
"suggest.localityBonus":~
Boost suggestions that appear closer to the cursor position.,
default: `true`
"suggest.triggerAfterInsertEnter":~
Trigger completion after InsertEnter, auto trigger should be 'always'
to enable this option, default: `false`
"suggest.timeout":~
Timeout for completion, in milliseconds., default: `2000`
"suggest.minTriggerInputLength":~
Minimal input length that triggers completion, default 1, default: `1`
"suggest.triggerCompletionWait":~
Wait time between typing the trigger character and starting
completion, to wait for server content synchronization., default: `60`
"suggest.echodocSupport":~
When enabled, add function signature to `user_data.signature` to support
`echodoc.vim`, default: `false`
"suggest.acceptSuggestionOnCommitCharacter":~
Controls whether suggestions should be accepted on commit characters.
For example, in JavaScript, the semi-colon (`;`) can be a commit
character that accepts a suggestion and types that character. Requires
`CompleteChanged` event to work., default: `false`
"suggest.noselect":~
Prevent vim from selecting the first item on completion start, default: `true`
"suggest.keepCompleteopt":~
When enabled, `completeopt` is not overridden. Autocompletion will be
disabled if `completeopt` doesn't have `noinsert` and `noselect`., default:
`false`
"suggest.lowPrioritySourceLimit":~
Max items count for source priority lower than 90.
"suggest.highPrioritySourceLimit":~
Max items count for source priority bigger than or equal to 90.
"suggest.completionItemKindLabels":~
Set custom labels to completion items' kinds., default: `{}`.
Example configuration: with https://nerdfonts.com: >
"suggest.completionItemKindLabels": {
"keyword": "\uf1de",
"variable": "\ue79b",
"value": "\uf89f",
"operator": "\u03a8",
"function": "\u0192",
"reference": "\ufa46",
"constant": "\uf8fe",
"method": "\uf09a",
"struct": "\ufb44",
"class": "\uf0e8",
"interface": "\uf417",
"text": "\ue612",
"enum": "\uf435",
"enumMember": "\uf02b",
"module": "\uf40d",
"color": "\ue22b",
"property": "\ue624",
"field": "\uf9be",
"unit": "\uf475",
"event": "\ufacd",
"file": "\uf723",
"folder": "\uf114",
"snippet": "\ue60b",
"typeParameter": "\uf728",
"default": "\uf29c"
}
<
"diagnostic.enable":~
Set to false to disable diagnostic display, default: `true`
"diagnostic.level":~
Used for filter diagnostics by diagnostic severity., default:
`"hint"`
Valid options: ["hint","information","warning","error"]
"diagnostic.checkCurrentLine":~
When enabled, show all diagnostics of current line instead of current
position., default: `false`
"diagnostic.messageTarget":~
Diagnostic message target., default: `"float"`
Valid options: ["echo","float"]
"diagnostic.joinMessageLines":~
Join lines messages to reduce lines of floating window., default:
`false`
"diagnostic.refreshOnInsertMode":~
Enable diagnostic refresh on insert mode, default false., default:
`false`
"diagnostic.refreshAfterSave":~
Only refresh diagnostics after save, default false., default: `false`
"diagnostic.displayByAle":~
Use Ale for displaying diagnostics in vim. This will disable coc for
displaying diagnostics. Restart required on change., default: `false`
"diagnostic.virtualText":~
Use NeoVim virtual text to display diagnostics, default: `false`
"diagnostic.virtualTextPrefix":~
The prefix added virtual text diagnostics, default: `" "`
"diagnostic.virtualTextLines":~
The number of non-empty lines from a diagnostic to display, default:
`3`
"diagnostic.virtualTextLineSeparator":~
The text that will mark a line end from the diagnostic message,
default: `" \\ "`
"diagnostic.enableSign":~
Enable signs for diagnostics., default: `true`
"diagnostic.enableMessage":~
When to enable echo messages of diagnostics., default: `"always"`
Valid options: ["always","jump","never"]
"diagnostic.locationlist":~
Create location list for error & warning, default: `true`
"diagnostic.highlightOffset":~
Offset number of buffer.addHighlight, neovim only., default: `1000`
"diagnostic.signOffset":~
Offset number of sign, default: `1000`
"diagnostic.errorSign":~
Text of error sign, default: `">>"`
"diagnostic.warningSign":~
Text of warning sign, default: `"⚠"`
"diagnostic.infoSign":~
Text of info sign, default: `">>"`
"diagnostic.hintSign":~
Text of hint sign, default: `">>"`
"diagnostic.maxWindowHeight":~
Maximum height of diagnostics floating window., default: `8`
"signature.enable":~
Enable signature help when trigger character typed, require restart
service on change., default: `true`
"signature.triggerSignatureWait":~
Wait time for trigger signature, default: `50`.
Change to higher value if your language server is slow.
"signature.target":~
Target of signature help, use float when possible by default.
Valid options: ["float","echo"]
"signature.preferShownAbove":~
Show signature help float window above cursor when possible, require
restart service on change., default: `true`
"signature.hideOnTextChange":~
Hide signature float window when text changed, require restart service
on change., default: `false`
"signature.maxWindowHeight":~
Maximum height of floating signature help window., default: `8`
"codeLens.enable":~
Enable `codeLens` feature, require neovim with set virtual text
feature., default: `false`
"codeLens.separator":~
Separator text for `codeLens` in virtual text, default: `"‣"`
"workspace.ignoredFiletypes":~
Filetypes that should be ignored for resolve workspace folder.,
default: `["markdown","log","txt","help"]`
"list.indicator":~
The character used as first character in prompt line, default: `">"`
"list.maxHeight":~
Maximum height of list window., default: `10`
"list.signOffset":~
Sign offset of list, should be different from other plugins.,
default: `900`
"list.selectedSignText":~
Sign text for selected lines., default: `"*"`
"list.autoResize":~
Enable auto-resize feature., default: `true`
"list.limitLines":~
Limit lines for list buffer., default: `30000`
"list.maxPreviewHeight":~
Max height for preview window of list., default: `12`
"list.previewHighlightGroup":~
Highlight group used for highlight the range in preview window.,
default: `"Search"`
"list.nextKeymap":~
Key used for select next line on insert mode., default: `"<C-j>"`
"list.previousKeymap":~
Key used for select previous line on insert mode., default: `"<C-k>"`
"list.extendedSearchMode": ~
Enable extended search mode which allows multiple search patterns delimited by spaces.
"list.normalMappings":~
Custom keymappings on normal mode., default: `{}`
"list.insertMappings":~
Custom keymappings on insert mode., default: `{}`
"coc.preferences.useQuickfixForLocations":~
Use vim's quickfix list for jump locations, need restart on change.,
default: `false`
"coc.preferences.extensionUpdateCheck":~
Interval for check extension update, could be daily, weekly, never,
default: `"daily"`
Valid options: ["daily","weekly","never"]
"coc.preferences.snippetStatusText":~
Text shown in statusline to indicate snippet session is activated.,
default: `"SNIP"`
"coc.preferences.hoverTarget":~
Target to show hover information, default is floating window when
possible.
Valid options: ["preview","echo","float"]
"coc.preferences.colorSupport":~
Enable color highlight if language server support it., default:
`true`
"coc.preferences.previewAutoClose":~
Auto close preview window on cursor move., default: `true`
"coc.preferences.currentFunctionSymbolAutoUpdate":~
Automatically update the value of `b:coc_current_function` on
`CursorHold` event, default: `false`
"coc.preferences.formatOnInsertLeave":~
Trigger format on type when insert leave by send \n to the server.
Default: `false`
"coc.preferences.formatOnSaveFiletypes":~
Filetypes that should run format on save., default: `[]`
"coc.preferences.enableFloatHighlight":~
Enable highlight for floating window., default: `true`
"coc.preferences.rootPatterns":~
Root patterns to resolve workspaceFolder from parent folders of opened
files, resolved from up to down., default:
`[".vim",".git",".hg",".projections.json"]`
"coc.preferences.watchmanPath":~
Executable path for https://facebook.github.io/watchman/, detected
from $PATH by default, default: `null`
"coc.preferences.jumpCommand":~
Command used for location jump, like goto definition, goto references
etc., default: `"edit"`
Valid options: ["edit","split","vsplit","tabe","drop","tab drop"]
"coc.preferences.messageLevel":~
Message level for filter echoed messages, could be 'more', 'warning'
and 'error', default: `"more"`
Valid options: ["more","warning","error"]
"coc.preferences.bracketEnterImprove":~
Improve handling of pressing enter inside brackets (`<> {} [] ()`) by
adding a new empty line below and moving the cursor to it. Works with
`coc#on_enter()`, default: `true`
"coc.preferences.formatOnType":~
Set to true to enable format on type, default: `false`
"coc.preferences.snippets.enable":~
Set to false to disable snippets support., default: `true`
"list.source.outline.ctagsFilestypes":~
Filetypes that should use `ctags` for outline instead of language
server., default: `[]`
"npm.binPath":~
Command or full path of npm or yarn executable for install/update
extenextensions, use `npm` by default.
"languageserver":~
Dictionary of languageservers, key is used as id of languageserver.,
default: `{}`
==============================================================================
COMPLETION *coc-completion*
Completion is triggered automatically by default, you can change completion
behavior in the configuration file.
Tips:~
- 'completeopt' used by coc.nvim default to `noselect,menuone`.
- Your 'completeopt' option would be changed and restored during completion,
so you can still use `menu,preview` for vim's builtin completion.
- Snippet expand and additional edit feature of LSP requires confirm
completion to work.
- Neovim 0.4.0 is required for floating window to work.
------------------------------------------------------------------------------
Example configuration:~
Map <tab> to trigger completion and navigate to the next item: >
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
Map <c-space> to trigger completion: >
inoremap <silent><expr> <c-space> coc#refresh()
<
<CR> to confirm completion, use: >
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<CR>"
<
To make <CR> auto-select the first completion item and notify coc.nvim to
format on enter, use: >
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
Map <tab> for trigger completion, completion confirm, snippet expand and jump
like VSCode. >
inoremap <silent><expr> <TAB>
\ pumvisible() ? coc#_select_confirm() :
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_snippet_next = '<tab>'
<
Note: the `coc-snippets` extension is required for this to work.
==============================================================================
INTERFACE *coc-interface*
------------------------------------------------------------------------------
Coc doesn't come with a default global keymap, you need to configure the
mappings yourself.
Keymappings *coc-key-mappings*
Note: Mappings that start with `i_` works for insert mode `n_` works for
normal mode, `v_` works for visual mode.
<Plug>(coc-diagnostic-info) *n_coc-diagnostic-info*
Show diagnostic message of current position, no
truncate.
<Plug>(coc-diagnostic-next) *n_coc-diagnostic-next*
Jump to next diagnostic position.
<Plug>(coc-diagnostic-prev) *n_coc-diagnostic-prev*
Jump to previous diagnostic position.
<Plug>(coc-diagnostic-next-error) *n_coc-diagnostic-next-error*
Jump to next diagnostic error position.
<Plug>(coc-diagnostic-prev-error) *n_coc-diagnostic-prev-error*
Jump to previous diagnostic error position.
<Plug>(coc-definition) *n_coc-definition*
Jump to definition(s) of current symbol.
<Plug>(coc-declaration) *n_coc-declaration*
Jump to declaration(s) of current symbol.
<Plug>(coc-implementation) *n_coc-implementation*
Jump to implementation(s) of current symbol.
<Plug>(coc-type-definition) *n_coc-type-definition*
Jump to type definition(s) of current symbol.
<Plug>(coc-references) *n_coc-references*
Jump to references of current symbol.
<Plug>(coc-format-selected) *n_coc-format-selected*
*v_coc-format-selected*
Format selected range, would work in both visual mode
and normal mode, when used in normal mode, the
selection works on the motion object.
For example: >
vmap <leader>p <Plug>(coc-format-selected)
nmap <leader>p <Plug>(coc-format-selected)
<
makes `<leader>p` format the visually selected range, and you can use
`<leader>pap` to format a paragraph.
<Plug>(coc-format) *n_coc-format*
Format the whole buffer, normally you would like to
use a command like: >
command! -nargs=0 Format :call CocAction('format')
<
to format the current buffer.
<Plug>(coc-rename) *n_coc-rename*
Rename symbol under cursor to a new word.
<Plug>(coc-codeaction) *n_coc-codeaction*
Get and run code action(s) for current line.
<Plug>(coc-codeaction-selected) *n_coc-codeaction-selected*
*v_coc-codeaction-selected*
Get and run code action(s) with the selected region.
Works with both normal and visual mode.
<Plug>(coc-openlink) *n_coc-openlink*
Open link under cursor.
<Plug>(coc-codelens-action) *n_coc-codelens-action*
Do command from codeLens of current line.
<Plug>(coc-fix-current) *n_coc-fix-current*
Try to run quickfix action for diagnostics on the
current line.
<Plug>(coc-float-hide) *n_coc-float-hide*
Hide all float windows.
<Plug>(coc-float-jump) *n_coc-float-jump*
Jump to first float window.
<Plug>(coc-refactor) *n_coc-refactor*
Open refactor window for refactor of current symbol.
<Plug>(coc-range-select) *n_coc-range-select*
<Plug>(coc-range-select) *v_coc-range-select*
Select next selection range.
Note: requires selection ranges feature of language
server, like: coc-tsserver, coc-python
<Plug>(coc-range-select-backward) *v_coc-range-select-backward*
Select previous selection range.
Note: requires selection ranges feature of language
server, like: coc-tsserver, coc-python
<Plug>(coc-funcobj-i) *n_coc-funcobj-i* *v_coc-funcobj-i*
Select inside function, mapped to `if` by default.
<Plug>(coc-funcobj-a) *n_coc-funcobj-a* *v_coc-funcobj-a*
Select current function, mapped to `af` by default.
------------------------------------------------------------------------------
VARIABLES *coc-variables*
b:coc_enabled *b:coc_enabled*
Set to `0` on buffer create if you don't want
coc.nvim send buffer events for this buffer, including
buffer create, change and unload.
b:coc_root_patterns *b:coc_root_patterns*
Root patterns used for resolving workspaceFolder for
the current file, will be used instead of
`"coc.preferences.rootPatterns"` setting. E.g.: >
autocmd FileType python let b:coc_root_patterns =
\ ['.git', '.env']
<
b:coc_suggest_disable *b:coc_suggest_disable*
Disable completion support of current buffer. E.g.: >
" Disable completion for python
autocmd FileType python let b:coc_suggest_disable = 1
b:coc_suggest_blacklist *b:coc_suggest_blacklist*
Words for which completion should be disabled. E.g.: >
" Disable completion for 'end' in lua files
autocmd FileType lua let b:coc_suggest_blacklist = ["end"]
b:coc_additional_keywords *b:coc_additional_keywords*
Addition keyword characters for generate keywords. E.g.: >
" Add keyword characters for css
autocmd FileType css let b:coc_additional_keywords = ["-"]
b:coc_current_function *b:coc_current_function*
Function string that current cursor in.
Set `"coc.preferences.currentFunctionSymbolAutoUpdate": true`
in coc-settings.json to update it on CursorHold.
g:coc_last_hover_message *g:coc_last_hover_message*
Last message echoed from `doHover`, can be used in
statusline.
Note: not used when floating or preview window used
for `doHover`.
g:coc_start_at_startup *g:coc_start_at_startup*
Start coc service on startup, use |CocStart| to start
server when you set it to 0.
Default: 1
g:coc_user_config *g:coc_user_config*
User configuration object, define this variable when
you can't use |coc#config()|
g:coc_extension_root *g:coc_extension_root*
Location that coc extensions would be installed to,
empty to use default location:
Windows:
`~/AppData/Local/coc/extensions`
Other:
`~/.config/coc/extensions`
g:coc_global_extensions *g:coc_global_extensions*
Global extension names to install when they aren't
installed, define this variable to a list of extension
names when you can't use |coc#add_extension()|
g:coc_cygqwin_path_prefixes *g:coc_cygqwin_path_prefixes*
When running under cygwin, the node process will work
with win32 paths, while your vim process will work
with POSIX paths. You can use this map to map between
paths. For example, your root folder might be
`c:/Users/myUser/workspace` mapped in cygwin as
`/home/myUser/workspace`. In this situation, your node
process might send the `c:/Users/myUser/workspace`
path to your vim process. To solve this, you need to
define this map:
`let g:coc_cygqwin_path_prefixes = `
` \{'c:/Users/myUser': '/home/myUser'}`
g:coc_enable_locationlist *g:coc_enable_locationlist*
Open location list when location list changes.
Default: 1
g:coc_snippet_next *g:coc_snippet_next*
Trigger key for going to the next snippet position,
applied in insert and select mode.
Only works when snippet session is activated.
Default: <C-j>
g:coc_snippet_prev *g:coc_snippet_prev*
Trigger key for going to the previous snippet
position, applied in insert and select mode.
Only works when snippet session is activated.
Default: <C-k>
g:coc_filetype_map *g:coc_filetype_map*
Map for document filetypes so the server could handle
current document as another filetype, ex: >
let g:coc_filetype_map = {
\ 'html.swig': 'html',
\ 'wxss': 'css',
\ }
<
Default: {}
Note: coc will always map filetype `javascript.jsx` to
`javascriptreact` and `typescript.tsx` to
`typescriptreact`.
g:coc_selectmode_mapping *g:coc_selectmode_mapping*
Add key mappings for making snippet select mode
easier. >
snoremap <silent> <BS> <c-g>c
snoremap <silent> <DEL> <c-g>c
snoremap <silent> <c-h> <c-g>c
snoremap <c-r> <c-g>"_c<c-r>
<
Default: 1
g:coc_node_path *g:coc_node_path*
Path to node executable to start coc service. ex: >
let g:coc_node_path = '/usr/local/opt/node@10/bin/node'
<
Use this when coc has problems with your system node,
Note: you have to use `$HOME` as home directory.
g:coc_force_debug *g:coc_force_debug*
Coc would use the precompiled bundle when the bundle
file exists, set this to 1 to use compiled code instead
of bundle.
Default: 0
g:coc_node_args *g:coc_node_args*
Arguments passed to node when starting coc
service from source code.
Useful for starting coc in debug mode, ex: >
let g:coc_node_args = ['--nolazy', '--inspect-brk=6045']
<
Default: []
g:coc_jump_locations *g:coc_jump_locations*
This variable would be set to jump locations when the
|CocLocationsChange| autocmd is fired.
Each location item contains:
'filename': full file path.
'lnum': line number (1 based).
'col': column number(1 based).
'text': line content of location.
g:coc_process_pid *g:coc_process_pid*
Process pid of coc service.
g:coc_status_error_sign *g:coc_status_error_sign*
Error character used for statusline, default: `E`
g:coc_status_warning_sign *g:coc_status_warning_sign*
Warning character used for statusline, default: `W`
g:coc_watch_extensions *g:coc_watch_extensions*