Skip to content
Qiming zhao edited this page Jan 24, 2019 · 18 revisions

Coc list is created to make work with list of objects easier, like locations.

Coc list is ispired by denite.nvim, it's faster and doesn't require python support (mostly, you still need python available for vim8).

List features

  • Insert mode and normal mode, use insert mode for filter and normal mode to do everything else.

  • Actions for items, each list item have different actions, you can create kepmapping for them and type <tab> to run one of them.

  • Multiple selection, press <space> to toggle selection of an item or drag your mosue to select items.

  • Commands for previous list:

    • :CocListResume reopen last list, restore window and cursor postion.
    • :CocNext do default action with next item.
    • :CocPrev do default action with previous item.
  • Different match mode, coc use fuzzy match by default, but you can change to use strict match or regex match.

  • Interactive mode, use --interactive in :CocList command 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.
  • Default keymappings, check out :h coc-list-mappings for 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. 2019-01-25 00_10_59

  • Number select feature, add --number-select to :CocList command, 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

    screen shot 2019-01-25 at 12 54 20 am

    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

    screen shot 2019-01-25 at 1 06 16 am

    Only best match characters get highlighted

Checkout :h coc-list for detailed documentation.

REPL

Clone this wiki locally