-
-
Notifications
You must be signed in to change notification settings - Fork 967
Using coc list
Coc list is created to make work with list of things easier, ex: locations & extensions.
Coc list is inspired by denite.nvim, it's faster and doesn't require python support (mostly, you still need python available for vim8).
-
Insert mode and normal mode, use insert mode for filter and normal mode to do everything else.
-
Actions for items, each list provide different actions, you can create key-mapping for them and type
<tab>to run one of them. -
Multiple selection, press
<space>to toggle selection of an item or drag your mouse to select items. -
Commands for previous list:
-
:CocListResumereopen last list, restore window and cursor position. -
:CocNextdo default action with next item. -
:CocPrevdo default action with previous item.
-
-
Different match modes, coc use fuzzy match by default, but you can change to use strict match or regex match.
-
Interactive mode, use
--interactivein:CocListcommand to start list in interactive mode, when activated, all items would be fetched on input change, and the list was sorted and filtered by list implementation.- Some source like
symbols(use workspace symbols feature of language server) only works on interactive mode. - Interactive is only available when list support it.
- Some source like
-
Default key-mappings, check out
:h coc-list-mappingsfor default mappings, you can override them by use"list.normalMappings"and"list.insertMappings"in configuration file. -
Auto preview feature: the preview window would be adjusted when cursor moved in list window.

-
Number select feature, add
--number-selectto:CocListcommand, then your can type 1-9 to do default action for that line of item. -
Parse ansi from item label, list can pass labels with ansi code, and the colors would be parsed and highlighted as expected
Using highlight form output of ripgrep
-
Mouse support, you can click to change cursor position, use double click to select item and do default action, use drag to select multiple items.
-
Advanced fuzzy score, for items with location, the match of filename would have higher score, beginning of path segment have higher score
Only best match characters get highlighted
-
Input history, you can use
<C-n>and<C-p>on insert mode to navigate command history list, the list is filtered with CWD and fuzzy match of current input (when not empty).
Checkout :h coc-list for detailed documentation.
-
When list is opened, you can still use mouse to scroll other vim windows.
-
Create custom key-mappings for do action easier, for example:
"list.normalMappings": { "t": "action:tabe", "v": "action:vsplit", "s": "action:split", "d": "expr:GetDeleteAction" }, "list.insertMappings": { "<C-t>": "action:tabe", "<C-w>": "command:wincmd k" },
-
You can move to other window when list is opened, the prompt would be deactivated then.
-
Use variables
g:terminal_color_{0-7}to customize ansi highlight colors, same as terminal colors of neovim:h terminal-configuration. -
Press
?on normal mode to get help.
-
outlineoutline of current document, provided by language server orctags. -
sourcesloaded completion sources. -
symbolssearch workspace symbol. -
commandsregistered coc commands. -
locationlatest jump locations. -
servicesregistered language client services. -
extensionsinstalled extensions. -
diagnosticsdiagnostics of current workspace -
linkslinks of current document, provided by language server. -
listsavailable list sources. -
outputcurrent output channels.
Some coc extensions make use of list feature:
-
coc-lists provide some basic lists, including
files,mru,grepetc. - coc-snippets provide snippets list.