diff --git a/doc/coc-api.txt b/doc/coc-api.txt index d4357962698..a0683ccc6a3 100644 --- a/doc/coc-api.txt +++ b/doc/coc-api.txt @@ -45,7 +45,7 @@ folder. With code: `init` and `complete` are required functions for vim sources, error message will be shown when not exists. -Source option:~ +Source option: ~ The source option object is returned by `coc#source#{name}#init` function, available properties: @@ -68,7 +68,7 @@ Source option:~ All options are optional. -Source configurations:~ +Source configurations: ~ Vim sources register |coc-configuration| for allow the user to customize the source behavior. @@ -81,7 +81,7 @@ Source configurations:~ • `coc.source.${name}.shortcut` Default to "shortcut" of source option. • `coc.source.${name}.filetypes` Default to "filetypes" of source option. -Complete function:~ +Complete function: ~ The complete function is called with complete option as the first argument and a callback function as the second argument, the callback function should @@ -127,7 +127,7 @@ Complete function:~ Only the "word" property is mandatory for complete items. -Optional functions:~ +Optional functions: ~ The vim source could provide some optional functions which would be invoked by coc.nvim: @@ -165,7 +165,7 @@ coc.nvim, for example: When `exports.deactivate` is exported from the JavaScript entry file as a function, it would be called on extension deactivate. -Limitation of extension context:~ +Limitation of extension context: ~ Some methods/properties provided by NodeJS can't be used inside extension context, including: @@ -332,11 +332,11 @@ To manually create an extension, follow these step: Recommended steps: • Install types of NodeJS and coc.nvim by terminal command - `npm install @types/node@16.18 coc.nvim` in extension folder. + `npm install @types/node@latest coc.nvim` in extension folder. • Bundle the javascript files when using multiple node dependencies by esbuild to save the time of installation. A typical build script looks - like: -> + like: > + async function start() { await require('esbuild').build({ entryPoints: ['src/index.ts'], @@ -358,7 +358,7 @@ Recommended steps: ------------------------------------------------------------------------------ DEBUG EXTENSIONS *coc-api-debug* -Uncaught errors:~ +Uncaught errors: ~ When an uncaught error raised on the NodeJS process, the error message would be send to vim through stderr, and echoed by vim (unless @@ -371,7 +371,7 @@ When error happens on the vim side, the promise would be rejected when sending request to vim, for notifications, vim would send `nvim_error_event` to the NodeJS process, and the node-client would create error log for it. -Use the log file:~ +Use the log file: ~ • Configure `NVIM_COC_LOG_LEVEL` to `trace` in vimrc: `let $NVIM_COC_LOG_LEVEL='trace'` @@ -382,7 +382,7 @@ Use the log file:~ code and compile the extension when needed. • Tail the log file by `tail` command and make the issue happen. -Add source map support:~ +Add source map support: ~ When the javascript code is bundled by esbuild, it would be useful to have correct source map support for the error stack. @@ -396,7 +396,7 @@ correct source map support for the error stack. Note: the source-map-support module slows down the coc.nvim initialization. -Debug javascript code in chrome:~ +Debug javascript code with chrome: ~ • Add `let g:coc_node_args = ['--nolazy', '--inspect-brk=5858']` • Open vim and you will get the error message indicate that the debugger is diff --git a/doc/coc-config.txt b/doc/coc-config.txt index 67ce1f97370..8f360bf0cfc 100644 --- a/doc/coc-config.txt +++ b/doc/coc-config.txt @@ -47,7 +47,7 @@ CORE FEATURES Configurations of builtin features. ------------------------------------------------------------------------------ -Workspace~ +WORKSPACE *coc-config-workspace* "workspace.rootPatterns" *coc-config-workspace-rootPatterns* @@ -104,7 +104,7 @@ Workspace~ Scope: `application`, default: `true` ------------------------------------------------------------------------------ -Extensions~ +EXTENSIONS *coc-config-extensions* "extensions.updateCheck" *coc-config-extensions-updateCheck* @@ -126,7 +126,7 @@ Extensions~ Scope: `application`, default: `false` ------------------------------------------------------------------------------ -Preferences~ +PREFERENCES *coc-config-preferences* "coc.preferences.bracketEnterImprove" *coc-preferences-bracketEnterImprove* @@ -276,7 +276,7 @@ Preferences~ Scope: `application`, default: `0` ------------------------------------------------------------------------------ -FloatFactory~ +FLOATfACTORY *coc-config-floatFactory* "floatFactory.floatConfig" *coc-config-floatFactory-floatConfig* @@ -288,7 +288,7 @@ FloatFactory~ ------------------------------------------------------------------------------ -Float configuration~ +FLOAT CONFIGURATION *coc-config-float* Used by `floatFactory.floatConfig`, `suggest.floatConfig`, @@ -327,7 +327,7 @@ following properties are supported: Takes precedence over `left` if both are set." ------------------------------------------------------------------------------ -Tree~ +TREE *coc-config-tree* Configurations for tree view. @@ -400,7 +400,7 @@ Configurations for tree view. Scope: `application`, default: `""` ------------------------------------------------------------------------------ -Dialog~ +DIALOG *coc-config-dialog* Configurations for dialog windows. @@ -464,7 +464,7 @@ Configurations for dialog windows. Scope: `application`, default: `"MoreMsg"` ------------------------------------------------------------------------------ -Http proxy~ +HTTP PROXY *coc-config-http* Configurations for http requests, used by coc.nvim and some coc extensions. @@ -497,7 +497,7 @@ Configurations for http requests, used by coc.nvim and some coc extensions. Scope: `application`, default: `true` ------------------------------------------------------------------------------ -Npm~ +NPM *coc-config-npm* "npm.binPath" *coc-config-npm-binPath* @@ -507,7 +507,7 @@ Npm~ Scope: `application`, default: `"npm"` ------------------------------------------------------------------------------ -Languageserver~ +LANGUAGESERVER *coc-config-languageserver* Dictionary of Language Servers, key is the ID of corresponding server, @@ -561,8 +561,8 @@ Languageserver~ this languageserver. - "disabledFeatures": Disable features for this languageserver, - valid keys: -> + valid keys: > + ["completion", "configuration", "workspaceFolders", "diagnostics", "willSave", "willSaveUntil", "didSaveTextDocument", "fileSystemWatcher", "hover", "signatureHelp", "definition", @@ -583,7 +583,7 @@ Languageserver~ - "progressOnInitialization": Enable progress report on languageserver initialize. -Language server start with command:~ +Language server start with command: ~ Additional fields can be used for a command languageserver: @@ -596,7 +596,7 @@ Language server start with command:~ - "shell": Use shell for server process, default: `false` -Language server start with module:~ +Language server start with module: ~ Additional fields can be used for a languageserver started by node module: @@ -616,7 +616,7 @@ Language server start with module:~ - "transportPort": Port number used when transport is 'socket'. -Language server use initialized socket server:~ +Language server use initialized socket server: ~ - "port": Port number of socket server. @@ -631,7 +631,7 @@ Configurations for features provided by language server. ------------------------------------------------------------------------------ -CallHierarchy~ +CALLHIERARCHY *coc-config-callHierarchy* "callHierarchy.enableTooltip" *coc-config-callHierarchy-enableTooltip* @@ -652,7 +652,7 @@ CallHierarchy~ Scope: `application`, default: `"botright 30vs"` ------------------------------------------------------------------------------ -CodeLens~ +CODELENS *coc-config-codeLens* "codeLens.enable" *coc-config-codeLens-enable* @@ -685,7 +685,7 @@ CodeLens~ Scope: `resource`, default: `" | "` ------------------------------------------------------------------------------ -Colors~ +COLORS *coc-config-colors* "colors.enable" *coc-config-colors-enable* @@ -701,7 +701,7 @@ Colors~ Scope: `application`, default: `1000` ------------------------------------------------------------------------------ -Cursors~ +CURSORS *coc-config-cursors* "cursors.cancelKey" *coc-config-cursors-cancelKey* @@ -728,7 +728,7 @@ Cursors~ Scope: `application`, default: `true` ------------------------------------------------------------------------------ -Diagnostic~ +DIAGNOSTIC *coc-config-diagnostic* "diagnostic.autoRefresh" *coc-config-diagnostic-autoRefresh* @@ -972,7 +972,7 @@ Diagnostic~ Scope: `language-overridable`, default: `true` ------------------------------------------------------------------------------ -DocumentHighlight~ +DOCUMENTHIGHLIGHT *coc-config-documentHighlight* "documentHighlight.priority" *coc-config-documentHighlight-priority* @@ -994,7 +994,7 @@ DocumentHighlight~ Scope: `resource`, default: `300` ------------------------------------------------------------------------------ -Hover~ +HOVER *coc-config-hover* "hover.autoHide" *coc-config-hover-autoHide* @@ -1023,7 +1023,7 @@ Hover~ Scope: `resource`, default: `float` ------------------------------------------------------------------------------ -InlayHint~ +INLAYHINT *coc-config-inlayHint* "inlayHint.enable" *coc-config-inlayHint-enable* @@ -1056,7 +1056,7 @@ InlayHint~ Scope: `language-overridable`, default: `inline` ------------------------------------------------------------------------------ -Links~ +LINK *coc-config-links* "links.enable" *coc-config-links-enable* @@ -1077,7 +1077,7 @@ Links~ Scope: `application`, default: `false` ------------------------------------------------------------------------------ -List~ +LIST *coc-config-list* "list.alignColumns" *coc-config-list-alignColumns* @@ -1233,7 +1233,7 @@ List~ Scope: `application`. ------------------------------------------------------------------------------ -Notification~ +NOTIFICATION *coc-config-notification* "notification.border" *coc-config-notification-border* @@ -1302,7 +1302,7 @@ Notification~ Scope: `application`, default: `30` ------------------------------------------------------------------------------ -Outline~ +OUTLINE *coc-config-outline* "outline.autoPreview" *coc-config-outline-autoPreview* @@ -1429,7 +1429,7 @@ Outline~ Scope: `application`, default: `"p"` ------------------------------------------------------------------------------ -PullDiagnostic~ +PULLDIAGNOSTIC *coc-config-pullDiagnostic* "pullDiagnostic.ignored" *coc-config-pullDiagnostic-ignored* @@ -1457,7 +1457,7 @@ PullDiagnostic~ Scope: `application`, default: `true` ------------------------------------------------------------------------------ -Refactor~ +REFACTOR *coc-config-refactor* "refactor.afterContext" *coc-config-refactor-afterContext* @@ -1491,7 +1491,7 @@ Refactor~ Scope: `application`, default: `""` ------------------------------------------------------------------------------ -SemanticTokens~ +SEMANTICTOKENS *coc-config-semanticTokens* "semanticTokens.combinedModifiers" *coc-config-semanticTokens-combinedModifiers* @@ -1520,7 +1520,7 @@ SemanticTokens~ Scope: `language-overridable`, default: `["variable","string","parameter"]` ------------------------------------------------------------------------------ -Signature~ +SIGNATURE *coc-config-signature* "signature.enable" *coc-config-signature-enable* @@ -1561,7 +1561,7 @@ Signature~ Scope: `language-overridable`, default: `500` ------------------------------------------------------------------------------ -Snippet~ +SNIPPET *coc-config-snippet* "snippet.highlight" *coc-config-snippet-highlight* @@ -1584,7 +1584,7 @@ Snippet~ Scope: `application`, default: `"SNIP"` ------------------------------------------------------------------------------ -Suggest~ +SUGGEST *coc-config-suggest* "suggest.acceptSuggestionOnCommitCharacter" *coc-config-suggest-acceptSuggestionOnCommitCharacter* @@ -1872,7 +1872,7 @@ Suggest~ Scope: `application`, default: `false` ------------------------------------------------------------------------------ -TypeHierarchy~ +TYPEHIERARCHY *coc-config-typeHierarchy* "typeHierarchy.enableTooltip" *coc-config-typeHierarchy-enableTooltip* diff --git a/doc/coc.txt b/doc/coc.txt index 9b80e5f971f..30701af21a7 100644 --- a/doc/coc.txt +++ b/doc/coc.txt @@ -80,7 +80,7 @@ specified by Language Server Protocol (3.17 for now), see |coc-lsp|. Some features (like completion) automatically works by default, all of them can be disabled by |coc-configuration|. -Some key features:~ +Some key features: ~ • Typescript APIs compatible with both Vim8 and Neovim. • Loading VSCode-like extensions |coc-api-extension|. @@ -162,7 +162,7 @@ Use `let $COC_NO_PLUGINS = '1'` in vimrc to disable the load of extensions. See |coc-api-extension| for the guide to create coc.nvim extension. -Install extensions from git (not recommended):~ +Install extensions from git (not recommended): ~ • Download the source code. • In project root, install dependencies and compile the code by `npm install` @@ -175,7 +175,7 @@ Note: use coc.nvim extensions from source code requires install dependencies, which may take huge disk usage. *coc-extensions-npm* -Install global extensions from npm (recommended):~ +Install global extensions from npm (recommended): ~ Use |:CocInstall| to install coc extensions from vim's command line. @@ -191,17 +191,17 @@ To customize npm registry for coc.nvim add `coc.nvim:registry` in your < To customize extension folder, configure |g:coc_data_home|. -Uninstall global extensions:~ +Uninstall global extensions: ~ Use |:CocUninstall|. -Update global extensions:~ +Update global extensions: ~ Use |:CocUpdate| or |:CocUpdateSync|. To configure extension update, see |coc-config-extensions|. -Manage extensions list:~ +Manage extensions list: ~ Use |coc-list-extensions| or |CocAction('extensionStats')| to get list of extensions. @@ -225,7 +225,7 @@ To fix the highlight of comment, use: < in your vimrc. -Global configuration file:~ +Global configuration file: ~ Command |:CocConfig| will open (create when necessary) a user settings file in the folder returned by |coc#util#get_config_home()|. @@ -238,7 +238,7 @@ The global configuration file can be created in another directory by setting let g:coc_config_home = '/path/to/folder' -Folder configuration file:~ +Folder configuration file: ~ To create a local configuration file for a specific workspace folder, use |:CocLocalConfig| to create and open `.vim/coc-settings.json` in current @@ -251,7 +251,7 @@ as workspace folder, it's best practice to start vim inside workspace folder, see |coc-workspace-folders|. *coc-configuration-expand* -Variables expands:~ +Variables expands: ~ Variables would be expanded in string values of configuration, supported variables: @@ -276,7 +276,7 @@ the filepath to user's home and some additional variables: • `${fileBasenameNoExtension}` the current opened file's basename with no file extension. *coc-configuration-scope* -Configuration scope:~ +Configuration scope: ~ A configuration could be one of three different configuration scopes: @@ -301,14 +301,14 @@ FLOATING WINDOWS *coc-floating* Floating windows/popups are created by |api-floatwin| on neovim or |popupwin| on vim. *coc-floating-scroll* -Scroll floating windows:~ +Scroll floating windows: ~ See |coc#float#has_scroll()| for example. Note: use |coc#pum#scroll()| for scroll popup menu. *coc-floating-close* -Close floating windows:~ +Close floating windows: ~ To close all floating windows/popups use |coc#float#close_all()| or |popup_clear()| on vim. Or you can use o on neovim which close all @@ -317,26 +317,26 @@ split windows as well. Or use |popup_clear()| on vim. To close single floating window/popup, use |coc#float#close()|. *coc-floating-focus* -Focus floating windows:~ +Focus floating windows: ~ On neovim, use w (or |(coc-float-jump)|) could focus a floating window just created (if it's focusable). It's not allowed to focus popups on vim, unless it's using a terminal buffer. *coc-floating-config* -Configure floating windows:~ +Configure floating windows: ~ To set custom window options on floating window create, use autocmd |CocOpenFloat| or |CocOpenFloatPrompt|. -Related variables: +Related variables: ~ • |g:coc_last_float_win| • |g:coc_borderchars| • |g:coc_border_joinchars| • |g:coc_markdown_disabled_languages| -Related highlight groups: +Related highlight groups: ~ • |CocFloating| For floating window background. • |CocFloatDividingLine| For dividing lines. @@ -369,7 +369,7 @@ LSP FEATURES *coc-lsp* Most features of LSP 3.17 are supported, checkout the specification at https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/ -Features not supported: +Features not supported: ~ • Telemetry. • Inline values for debugger. @@ -383,7 +383,7 @@ To check exists providers of current buffer, use command For historic reason, some features automatically works by default, but some are not. -Features automatically work by default:~ +Features automatically work by default: ~ • Trigger completion |coc-completion|. • Diagnostics refresh |coc-diagnostics|. @@ -401,7 +401,7 @@ To disable all features that automatically work, use configuration: "signature.enable": false, "inlayHint.enable": false, < -Features require enabled by configuration:~ +Features require enabled by configuration: ~ • Semantic highlights |coc-semantic-highlights|. • Document color highlights |coc-document-colors|. @@ -410,7 +410,7 @@ Features require enabled by configuration:~ • Format on type, enabled by |coc-preferences-formatOnType| • Format on save, enabled by |coc-preferences-formatOnSave|. -Features requested by user:~ +Features requested by user: ~ • Locations related (including definitions, references etc.) |coc-locations| • Invoke code action |coc-code-actions|. @@ -428,7 +428,7 @@ Features requested by user:~ For convenient, some actions have associated |coc-key-mappings| provided. Prefer |CocAction()| for more options. -Features triggered by languageserver:~ +Features triggered by languageserver: ~ • Show message notification (use |coc-notification|). • Show message request (use |coc-dialog-menu|). @@ -449,7 +449,7 @@ DOCUMENT *coc-document* An associated document is created on buffer create, and disposed on buffer unload. -Attached document:~ +Attached document: ~ *coc-document-attached* An attached document means coc.nvim synchronize the lines of vim's buffer with @@ -469,7 +469,7 @@ The buffer may not be attached by following reasons: Use |CocAction('ensureDocument')| or `:CocCommand document.checkBuffer` to check attached state of current buffer. -Filetype map:~ +Filetype map: ~ *coc-document-filetype* Some filetypes are mapped to others to match the languageId used by VSCode, @@ -485,7 +485,7 @@ Use |g:coc_filetype_map| to create additional filetype maps. Use `:CocCommand document.echoFiletype` to echo mapped filetype of current document. -Note make sure use mapped filetypes for configurations that expect filetypes. +Note: make sure use mapped filetypes for configurations that expect filetypes. ------------------------------------------------------------------------------ HOVER *coc-hover* @@ -493,7 +493,7 @@ HOVER *coc-hover* Hover feature provide information at a given text document position, normally include type information and documentation of current symbol. -Hover functions:~ +Hover functions: ~ • |CocAction('doHover')| Show hover information at cursor position. • |CocAction('definitionHover')||| Show hover information with definition @@ -501,7 +501,7 @@ Hover functions:~ • |CocAction('getHover')| Get hover documentations at cursor position. *coc-hover-example* -Hover key-mapping example:~ +Hover key-mapping example: ~ > nnoremap K :call ShowDocumentation() " Show hover when provider exists, fallback to vim's builtin behavior. @@ -528,7 +528,7 @@ now works like in VSCode: • 'completeopt' is not used and APIs of builtin popupmenu not work. *coc-completion-default* -Default Key-mappings:~ +Default Key-mappings: ~ To make the new completion work like the builtin completion, without any additional configuration, the following key-mappings are used when @@ -554,7 +554,7 @@ Use and to cancel and confirm completion: > Note: and are not remapped by coc.nvim. *coc-completion-variables* -Related variables:~ +Related variables: ~ • Disable completion for buffer: |b:coc_suggest_disable| • Disable specific sources for buffer: |b:coc_disabled_sources| @@ -562,7 +562,7 @@ Related variables:~ • Add additional keyword characters: |b:coc_additional_keywords| *coc-completion-functions* -Related functions:~ +Related functions: ~ • Trigger completion with options: |coc#start()|. • Trigger completion refresh: |coc#refresh()|. @@ -580,7 +580,7 @@ Related functions:~ • Scroll popupmenu: |coc#pum#scroll()|. *coc-completion-customize* -Customize completion:~ +Customize completion: ~ Use |coc-config-suggest| to change the completion behavior. @@ -595,7 +595,7 @@ Related Highlight groups: Note: background, border and winblend are configured by |coc-config-suggest-floatConfig|. -Example user key-mappings:~ +Example user key-mappings: ~ *coc-completion-example* Note: use command `:verbose imap` to check current insert @@ -662,11 +662,8 @@ Note most language servers only send diagnostics for opened buffers for performance reason, some lint tools could provide diagnostics for all files in workspace. -Note pull diagnostics feature is added in LSP 3.17, which is not available -yet. - *coc-diagnostics-refresh* -Changes on diagnostics refresh~ +Changes on diagnostics refresh ~ • Add highlights for diagnostic ranges and virtual text (when enabled on neovim or vim >= 9.0.0067), see |coc-highlights-diagnostics|. @@ -678,12 +675,10 @@ Changes on diagnostics refresh~ Diagnostics are not refreshed when buffer is hidden, and refresh on insert mode is disabled by default. -Diagnostics highlights:~ - -See |coc-highlights-diagnostics|. +See |coc-highlights-diagnostics| for highlight groups used by diagnostics. *coc-diagnostics-toggle* -Enable and disable diagnostics~ +Enable and disable diagnostics ~ Use |coc-config-diagnostic-enable| to toggle diagnostics feature. @@ -692,7 +687,7 @@ Use |CocAction('diagnosticToggle')| for enable/disable diagnostics feature. Use |CocAction('diagnosticToggleBuffer')| for enable/disable diagnostics of current buffer. -Show diagnostic messages~ +Show diagnostic messages ~ Diagnostic messages would be automatically shown/hide when the diagnostics under cursor position changed (use float window/popup when possible) by @@ -702,7 +697,7 @@ To manually refresh diagnostics messages, use |(coc-diagnostic-info)| and |CocAction('diagnosticPreview')|. *coc-diagnostics-jump* -Jump between diagnostics~ +Jump between diagnostics ~ Use key-mappings: @@ -711,11 +706,12 @@ Use key-mappings: |(coc-diagnostic-next-error)| jump to next error. |(coc-diagnostic-prev-error)| jump to previous error. -Check all diagnostics~ +Check diagnostics ~ Use |coc-list-diagnostics| to open |coc-list| with all available diagnostics. - Use API |CocAction('diagnosticList')| to get list of all diagnostics. +Use |:CocDiagnostics| to open vim's location list with diagnostics of current +buffer. ------------------------------------------------------------------------------ PULL DIAGNOSTICS SUPPORT *coc-pullDiagnostics* @@ -734,7 +730,7 @@ LOCATIONS SUPPORT *coc-locations* There're different kinds of locations, including "definitions", "declarations", "implementations", "typeDefinitions" and "references". -Key-mappings for invoke locations request~ +Key-mappings for invoke locations request ~ • |(coc-definition)| • |(coc-declaration)| @@ -746,7 +742,7 @@ Key-mappings for invoke locations request~ Error will be shown when the buffer not attached |coc-document-attached|. Message will be shown when no result found. -Location jump behavior~ +Location jump behavior ~ When there's only one location returned, the location is opened by command specified by |coc-preferences-jumpCommand| ("edit" by default), context mark @@ -767,7 +763,7 @@ To use vim's quickfix for locations, use configuration To use vim's tag list for definitions, use |CocTagFunc()|. *coc-locations-api* -Related APIs~ +Related APIs ~ • |CocAction('jumpDefinition')| Jump to definition locations. • |CocAction('jumpDeclaration')| Jump to declaration locations. @@ -796,23 +792,23 @@ confirmed. Check if current buffer has rename provider with `:echo CocAction('hasProvider', 'rename')` -Rename key-mappings:~ +Rename key-mappings: ~ • |(coc-rename)| -Rename functions:~ +Rename functions: ~ • |CocAction('rename')| Rename the symbol under the cursor. • |CocAction('refactor')| Open refactor buffer for all references (including definitions), recommended for function signature refactor. -Rename local variable:~ +Rename local variable: ~ Use command `:CocCommand document.renameCurrentWord` which uses |coc-cursors| to edit multiple locations at the same time and defaults to word extraction when rename provider doesn't exist. -Rename configuration:~ +Rename configuration: ~ Use |coc-preferences-renameFillCurrent| to enable/disable populating prompt window with current variable name. @@ -826,7 +822,7 @@ window/popup to show relevant documentation. Use |CocAction('showSignatureHelp')| to trigger signature help manually. -Note error will not be thrown when provider does not exist or nothing is returned +Note: error will not be thrown when provider does not exist or nothing is returned by languageserver, use `echo CocAction('hasProvider', 'signature')` to check if a signature help provider exists. @@ -846,13 +842,13 @@ works. To temporarily toggle inlay hint of current buffer, use command `:CocCommand document.toggleInlayHint` -Change highlight group:~ +Change highlight group: ~ • |CocInlayHint| • |CocInlayHintType| • |CocInlayHintParameter| -Configure inlay hint support:~ +Configure inlay hint support: ~ |coc-config-inlayHint| @@ -867,7 +863,7 @@ your buffer if the indent is wrong after character insert. (use |coc-format-ontype| might helps with the indent) *coc-format-options* -Format options:~ +Format options: ~ Buffer options that affect document format: 'eol', 'shiftwidth' and 'expandtab'. @@ -881,7 +877,7 @@ languageservers before format. Note: the languageservers may only support some of those options. *coc-format-document* -Format full document:~ +Format full document: ~ Use |CocAction('format')|, you can create a command like: > @@ -890,7 +886,7 @@ Use |CocAction('format')|, you can create a command like: > to format current buffer. *coc-format-ontype* -Format on type:~ +Format on type: ~ Format on type could be enabled by |coc-preferences-formatOnType|. @@ -903,7 +899,7 @@ If you don't like the behavior on type bracket characters, configure |coc-preferences-bracketEnterImprove||. *coc-format-selected* -Format selected code:~ +Format selected code: ~ Use 'formatexpr' for specific filetypes: > @@ -917,7 +913,7 @@ Setup visual mode and operator key-mappings: > nmap f (coc-format-selected) < *coc-format-onsave* -Format on save:~ +Format on save: ~ To enable format on save, use configuration |coc-preferences-formatOnSave|. @@ -945,7 +941,7 @@ Possible code action kinds: • `source` code actions apply to the entire file. • `organizeImport` organize import statements of current document. -Key-mappings for code actions:~ +Key-mappings for code actions: ~ • |(coc-fix-current)| Invoke quickfix action at current line if any. • |(coc-codeaction-cursor)| Choose code actions at cursor position. @@ -967,7 +963,7 @@ To invoke organize import action, use command like: See |CocAction('organizeImport')| for details. -Related APIs~ +Related APIs ~ • |CocAction('codeActions')| • |CocAction('organizeImport')| @@ -1031,11 +1027,11 @@ Highlight and tooltip of the links could be configured by |coc-config-links|. Use |coc-list-links| to manage list of links in current document. -Document link key-mappings:~ +Document link key-mappings: ~ |(coc-openlink)| -Document link functions:~ +Document link functions: ~ • |CocAction('openLink')| Open link under cursor. • |CocAction('links')| Get link list of current buffer. @@ -1053,14 +1049,14 @@ Select the complete item and confirm the completion by |coc#pum#confirm()| or |coc#_select_confirm()| to expand the snippet of current selected complete ttem. -Jump snippet placeholders:~ +Jump snippet placeholders: ~ |g:coc_snippet_next| and |g:coc_snippet_prev| are used to jump placeholders on both select mode and insert mode, which defaults to and . Buffer key-mappings are created on snippet activate, and removed on snippet deactivate. -Deactivate snippet session:~ +Deactivate snippet session: ~ A snippet session would be deactivated under the following conditions: @@ -1075,7 +1071,7 @@ Use |CocAction('snippetCancel')| for cancel snippet session manually. To load and expand custom snippets, install `coc-snippets` extension is recommended. -Related configurations:~ +Related configurations: ~ • |g:coc_snippet_prev| • |g:coc_snippet_next| @@ -1086,7 +1082,7 @@ Related configurations:~ • |coc-config-snippet-statusText| • |coc-config-snippet-nextPlaceholderOnDelete| -Related functions:~ +Related functions: ~ • |coc#snippet#next()| • |coc#snippet#prev()| @@ -1094,7 +1090,7 @@ Related functions:~ • |coc#jumpable()| • |coc#expandableOrJumpable()| -Related variables, highlights and autocmds:~ +Related variables, highlights and autocmds: ~ • |b:coc_snippet_active| Check if snippet session is activated. • |CocSnippetVisual| For highlight of current placeholders. @@ -1104,7 +1100,7 @@ Related variables, highlights and autocmds:~ WORKSPACE SUPPORT *coc-workspace* *coc-workspace-folders* -Workspace folders~ +Workspace folders ~ Unlike VSCode which prompt you to open folders, workspace folders of coc.nvim are resolved from filepath after document attached. @@ -1142,7 +1138,7 @@ To manage current workspace folders, use |coc-list-folders| To get related root patterns of current buffer, use |coc#util#root_patterns()| *coc-workspace-edits* -Workspace edit~ +Workspace edit ~ Workspace edit is used to apply changes for multiple buffers(and/or files), the edit could contains document edits and file operations (including file create, @@ -1313,18 +1309,18 @@ information with current buffer. To create custom highlights for symbol under cursor, follow these steps: - • Inspect semantic token by -> + • Inspect semantic token by > + :CocCommand semanticTokens.inspect < to check token type and token modifiers with current symbol. - • Create new highlight group by |highlight|, for example: -> + • Create new highlight group by |highlight|, for example: > + :hi link CocSemDeclarationVariable MoreMsg < - • Refresh semantic highlight of current buffer by: -> + • Refresh semantic highlight of current buffer by: > + :CocCommand semanticTokens.refreshCurrent < See |CocSem| to customize semantic token highlight groups. @@ -1348,12 +1344,12 @@ Select range forward or backward at cursor position. Check if current buffer have selection range provider by `:echo CocAction('hasProvider', 'selectionRange')` -Selection range key-mappings:~ +Selection range key-mappings: ~ • |(coc-range-select)| Select range forward. • |(coc-range-select-backward)| Select range backward. -Selection range function:~ +Selection range function: ~ • |CocAction('rangeSelect')| Visual select previous or next selection range @@ -1418,7 +1414,7 @@ Note: Use 'noremap' with will make the key-mapping not work at all. Note: key-mappings are provided for convenient, use |CocActionAsync()| or |CocAction()| for more options. -Normal mode key-mappings:~ +Normal mode key-mappings: ~ *(coc-diagnostic-info)* Show diagnostic message of current position by invoke |CocAction('diagnosticInfo')| @@ -1566,7 +1562,7 @@ line. *(coc-cursors-position)* Add current position as empty range to cursors session. -Visual mode key-mappings:~ +Visual mode key-mappings: ~ *(coc-range-select-backward)* @@ -1580,7 +1576,7 @@ Visual mode key-mappings:~ -------------------------------------------------------------------------------- VARIABLES *coc-variables* -User defined variables:~ +User defined variables: ~ -------------------------------------------------------------------------------- @@ -2255,7 +2251,7 @@ coc#pum#select({index}, {insert}, {confirm}) *coc#pum#select()* Selects an item in the completion popupmenu. Return empty string. - Parameters:~ + Parameters: ~ {index} Index (zero-based) of the item to select. {insert} Whether the selection should be inserted in the buffer. @@ -2279,7 +2275,7 @@ coc#pum#scroll({forward}) *coc#pum#scroll()* Timer is used to make it works as {rhs} of key-mappings. Return . - Parameters:~ + Parameters: ~ {forward} Scroll forward when none zero. *coc#notify* @@ -3062,7 +3058,7 @@ COMMANDS *coc-commands* Note: the search is performed on your files, so normally you should save your buffers before invoke this command. - Common arguments for ripgrep:~ + Common arguments for ripgrep: ~ `-e` `--regexp`: treat search pattern as regexp. `-F` `--fixed-strings`: treat search pattern as fixed string. @@ -3086,7 +3082,7 @@ COMMANDS *coc-commands* Note: By default, vcs ignore files including `.gitignore` and `.ignore` are respected - Escape arguments:~ + Escape arguments: ~ || is used to convert command line arguments to arguments of rg, which means you have to escape space for single argument. For @@ -3100,7 +3096,7 @@ COMMANDS *coc-commands* < for strict match. - Change and save:~ + Change and save: ~ Refactor session is started with searched patterns highlighted, just change the text and save refactor buffer to make changes across all @@ -3200,7 +3196,7 @@ Note: user defined highlight commands should appear after the |:colorscheme| command and use |ColorScheme| autocmd to make sure customized highlights works after color scheme change. -Markdown related~ +Markdown related ~ *CocBold* for bold text. *CocItalic* for italic text. @@ -3210,7 +3206,7 @@ Markdown related~ *CocMarkdownHeader* for markdown header in floating window/popup. *CocMarkdownLink* for markdown link text in floating window/popup. -Diagnostics related~ +Diagnostics related ~ *coc-highlights-diagnostics* *CocFadeOut* for faded out text, such as for highlighting unnecessary code. @@ -3241,7 +3237,7 @@ The priority order: |CocUnusedHighlight| > |CocDeprecatedHighlight| > |CocErrorHighlight| > |CocWarningHighlight| > |CocInfoHighlight| > |CocHintHighlight| -Document highlight related~ +Document highlight related ~ *coc-highlights-document* Highlights used for highlighting same symbols in the buffer at the current @@ -3251,7 +3247,7 @@ cursor position. *CocHighlightRead* for `Read` kind of document symbol. *CocHighlightWrite* for `Write` kind of document symbol. -Float window/popup related~ +Float window/popup related ~ *coc-highlights-float* *CocFloating* default highlight group of floating windows/popups. @@ -3263,7 +3259,7 @@ Default links to |NormalFloat| on neovim and |Pmenu| on vim. *CocErrorFloat* for error text in floating windows/popups. *CocHintFloat* for hint text in floating windows/popups. -Inlay hint related~ +Inlay hint related ~ *coc-highlights-inlayHint* *CocInlayHint* for highlight inlay hint virtual text block, default uses @@ -3271,7 +3267,7 @@ foreground from |CocHintSign| and background from |SignColumn| *CocInlayHintParameter* for parameter kind of inlay hint. *CocInlayHintType* for type kind of inlay hint. -Notification window/popup related~ +Notification window/popup related ~ CocNotification *CocNotification* @@ -3281,7 +3277,7 @@ CocNotification *CocNotification* *CocNotificationWarning* for highlight border of warning notification. *CocNotificationInfo* for highlight border of info notification. -List related~ +List related ~ *CocList* *CocSearch* for matched characters. @@ -3292,7 +3288,7 @@ List related~ *CocSelectedText* for sign text of selected lines (multiple selection only). *CocSelectedLine* for line highlight of selected lines (multiple selection only). -Tree view related~ +Tree view related ~ CocTree *CocTree* @@ -3301,7 +3297,7 @@ CocTree *CocTree* *CocTreeOpenClose* for open and close icon in tree view. *CocTreeSelected* for highlight lines contains selected node. -Popup menu related~ +Popup menu related ~ *CocPum* *CocPumSearch* for matched input characters, linked to |CocSearch| by default. *CocPumDetail* for highlight label details that follows label (including @@ -3312,7 +3308,7 @@ possible detail and description). *CocPumVirtualText* for virtual text which enabled by |coc-config-suggest-virtualText| -Symbol icons~ +Symbol icons ~ CocSymbol *CocSymbol* @@ -3359,7 +3355,7 @@ highlight groups when possible and fallback to builtin highlight groups. Note: Use configuration |coc-config-suggest-completionItemKindLabels| for customized icon characters. -Semantic token highlight groups~ +Semantic token highlight groups ~ *CocSem* Semantic highlight groups are starts with `CocSem` which link to related @@ -3384,7 +3380,7 @@ modifier with type, for example: < The modifier highlight groups have higher priority. -Others~ +Others ~ *CocDisabled* highlight for disabled items, eg: menu item. *CocCodeLens* for virtual text of codeLens. @@ -3484,6 +3480,8 @@ The following features are supported: • Multiple selections using in normal mode. • Select lines by visual selection. +To enable set filetype of preview window, use |g:coc_list_preview_filetype|. + -------------------------------------------------------------------------------- LIST COMMAND *coc-list-command* @@ -3535,7 +3533,7 @@ LIST COMMAND *coc-list-command* Invoke default action for last item in the last {name} list. *coc-list-options* -Options of CocList command~ +Options of CocList command ~ --top @@ -3626,7 +3624,7 @@ list (requires coc-json installed). For configuration of a specified list, use section that starts with: `list.source.{name}`, where `{name}` is the name of list. -Change default action:~ +Change default action: ~ If you want to use `tabe` as default action of symbols list, you can use: > @@ -3635,7 +3633,7 @@ If you want to use `tabe` as default action of symbols list, you can use: < in your coc-settings.json -Change default options:~ +Change default options: ~ To change |coc-list-options| for source with {name}, use `list.source.{name}.defaultOptions` configuration like: > @@ -3649,7 +3647,7 @@ include `--interactive` in `defaultOptions`. Note: default options will not be used when there're options passed with |:CocList| command. -Change default arguments:~ +Change default arguments: ~ Use `list.source.{name}.defaultArgs` setting like: > @@ -4090,13 +4088,13 @@ milliseconds specified by |coc-config-notification-timeout|. Use |coc-config-notification-disabledProgressSources| to disable progress notifications for specific sources. -Customize notifications:~ +Customize notifications: ~ • Customize icons: |g:coc_notify| • Customize highlights: |CocNotification| • Customize configurations: |coc-config-notification| -Related functions:~ +Related functions: ~ • |coc#notify#close_all()| • |coc#notify#do_action()|