• Stars
    star
    259
  • Rank 152,765 (Top 4 %)
  • Language
    TypeScript
  • Created over 5 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Common lists for coc.nvim

coc-lists

Some basic list sources for coc.nvim

Including:

  • buffers current buffer list.
  • changes changes list.
  • cmdhistory history of commands.
  • colors colors schemes.
  • files search files from current cwd.
  • filetypes file types.
  • grep grep text from current cwd.
  • helptags helptags of vim.
  • lines search lines by regex patterns.
  • locationlist items from vim's location list.
  • maps key mappings.
  • marks marks of vim.
  • mru most recent used files.
  • quickfix items from vim's quickfix list.
  • registers registers of vim.
  • searchhistory history of search.
  • sessions session list.
  • tags search tag files.
  • vimcommands available vim commands.
  • windows windows of vim.
  • words search word in current buffer.
  • functions available vim functions.

For snippets list, use coc-snippets.

For git related list, use coc-git.

For yank history, use coc-yank.

Install

In your vim/neovim, run command:

:CocInstall coc-lists

Checkout :h coc-list for usage.

Options

Tip: type ? on normal mode to get detail help of current list.

Available options for coc-lists:

  • session.saveOnVimLeave Save session on VimLeavePre., default to true
  • session.directory directory for session files, default to ~/.vim/sessions
  • session.restartOnSessionLoad Restart vim with cwd changed on session load, support neovim on iTerm2 only.
  • lists.disabledLists: List names to disable form load., default: []
  • list.source.files.command: Command used for search for files, default: ""
  • list.source.files.args: Arguments for search command, default: []
  • list.source.files.excludePatterns: Minimatch patterns that should be excluded., default: []
  • list.source.mru.maxLength: Max length of mru list., default: 1000
  • list.source.mru.ignoreGitIgnore: Ignore git ignored files., default: false
  • list.source.mru.excludePatterns: Minimatch patterns that should be excluded., default: ["**/.git/*","/tmp/*"]
  • list.source.grep.useLiteral: Use literal match unless specified regex options, default: true., default: true
  • list.source.grep.command: Command used for grep, default to 'rg'., default: "rg" could be rg or ag.
  • list.source.grep.maxColumns: Don't print lines longer than this limit in bytes, ripgrep only..
  • list.source.tags.command: Command used for generate tags., default: "ctags -R ."
  • list.source.grep.args: Arguments for grep command, always used for grep, default: []
  • list.source.grep.excludePatterns: Minimatch patterns of files that should be excluded, use .ignore file is recommended., default: []

Commands

  • mru.validate remove none exists files from mru list.
  • tags.generate generate tags of current project (in current cwd).
  • session.save save current vim state to session file.
  • session.load load exists session file.

F.A.Q

Q: Hidden files not exists using files source.

A: You have to pass --hidden to ripgrep by using configuration:

`list.source.files.args`: ['--hidden', '--files']

Q: How to ignore files using files/grep source.

A: You can add .ignore file in your project root, which would be respected by ripgrep or use list.sourcefiles.excludePatterns configuration.

Q: How to make grep easier?

A: Create custom command like:

" grep word under cursor
command! -nargs=+ -complete=custom,s:GrepArgs Rg exe 'CocList grep '.<q-args>

function! s:GrepArgs(...)
  let list = ['-S', '-smartcase', '-i', '-ignorecase', '-w', '-word',
        \ '-e', '-regex', '-u', '-skip-vcs-ignores', '-t', '-extension']
  return join(list, "\n")
endfunction

" Keymapping for grep word under cursor with interactive mode
nnoremap <silent> <Leader>cf :exe 'CocList -I --input='.expand('<cword>').' grep'<CR>

Q: How to grep by motion?

A: Create custom keymappings like:

vnoremap <leader>g :<C-u>call <SID>GrepFromSelected(visualmode())<CR>
nnoremap <leader>g :<C-u>set operatorfunc=<SID>GrepFromSelected<CR>g@

function! s:GrepFromSelected(type)
  let saved_unnamed_register = @@
  if a:type ==# 'v'
    normal! `<v`>y
  elseif a:type ==# 'char'
    normal! `[v`]y
  else
    return
  endif
  let word = substitute(@@, '\n$', '', 'g')
  let word = escape(word, '| ')
  let @@ = saved_unnamed_register
  execute 'CocList grep '.word
endfunction

Q: How to grep current word in current buffer?

A: Create kep-mapping like:

nnoremap <silent> <space>w  :exe 'CocList -I --normal --input='.expand('<cword>').' words'<CR>

Q: How to grep word in a specific folder?

A: Pass -- /folder/to/search/from to CocList grep

:CocList grep word -- /folder/to/search/from

License

MIT

More Repositories

1

coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
TypeScript
22,790
star
2

coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
TypeScript
1,000
star
3

coc-snippets

Snippets solution for coc.nvim
TypeScript
924
star
4

coc-python

Python extension for coc.nvim, fork of vscode-python
TypeScript
576
star
5

coc-prettier

Prettier extension for coc.nvim.
TypeScript
512
star
6

coc-tabnine

Tabnine integration of coc.nvim
TypeScript
470
star
7

coc-java

Java extension for coc.nvim
TypeScript
407
star
8

coc-git

Git integration of coc.nvim
TypeScript
401
star
9

coc-rls

Rust language server support for coc.nvim
TypeScript
378
star
10

coc-eslint

Eslint extension for coc.nvim
TypeScript
378
star
11

vim-jsx-improve

Syntax and indent plugin for React jsx.
Vim Script
285
star
12

coc-pairs

Basic auto pairs extension of coc.nvim
TypeScript
283
star
13

coc-json

Json language extension for coc.nvim
TypeScript
229
star
14

coc-yaml

Yaml language server extension for coc.nvim
TypeScript
226
star
15

coc-vetur

Vue language server extension for coc.nvim
TypeScript
217
star
16

coc-highlight

Document highlight and document colors LSP support for coc.nvim
TypeScript
210
star
17

coc-sources

Additional common sources of coc.nvim
JavaScript
200
star
18

coc-html

Html language server extension for coc.nvim.
TypeScript
196
star
19

coc-css

Css language server extension for coc.nvim
TypeScript
189
star
20

coc-solargraph

Solargraph extension for coc.nvim
TypeScript
188
star
21

coc-yank

Yank highlight and persist yank history support for vim
TypeScript
188
star
22

coc-emmet

Emmet extension for coc.nvim
TypeScript
169
star
23

coc-vimtex

vimtex integration for coc.nvim
JavaScript
121
star
24

denite-git

Manger list of git objects with interface of denite.nvim
Python
73
star
25

coc-smartf

Make jump to character easier.
TypeScript
73
star
26

vim-node-rpc

Make vim behavior like neovim rpc server by use node server in the middle.
TypeScript
61
star
27

jsonc.vim

jsonc syntax support for vim
Vim Script
60
star
28

denite-extra

extra useful sources for denite.nvim
Python
55
star
29

coc-jest

Jest extension for coc.nvim
TypeScript
51
star
30

coc-tslint-plugin

coc.nvim extension that provides TSLint support using the typescript-tslint-plugin
TypeScript
49
star
31

coc-r-lsp

R LSP Client for coc.nvim
TypeScript
48
star
32

coc-stylelint

Stylelint language server extension for coc.nvim
JavaScript
42
star
33

vim-easygit

A git wrapper focus on simplity and usability
Vim Script
38
star
34

coc-imselect

Input method enhance for iTerm2 on mac.
TypeScript
37
star
35

coc-typos

Typos integration with coc.nvim
TypeScript
32
star
36

neovim

Node client API for both vim8 and neovim.
TypeScript
28
star
37

npm.nvim

Npm plugin to make vim user works with npm easier
Python
26
star
38

redismru.vim

MRU plugin build for speed with async IO operation
Vim Script
25
star
39

coc-neco

viml completion source for coc.nvim
Vim Script
23
star
40

coc-denite

Denite support of coc.nvim
Python
22
star
41

todoapp.vim

Todo management in vim using unite and sqlite
Vim Script
20
star
42

neoclide

Web enhanced IDE forked from Nyaovim
JavaScript
18
star
43

coc-tslint

Tslint language server extension of coc.nvim
TypeScript
17
star
44

rename.nvim

Rename plugin for neovim
TypeScript
16
star
45

plug.nvim

None block plugin manager for neovim
TypeScript
14
star
46

coc-repl

Read-Eval-Print-Loop (REPL) for coc.nvim
JavaScript
12
star
47

macnote.vim

Light weight note manager on mac using vim
Vim Script
11
star
48

macdown.vim

Live preview markdown in Chrome using applescript
JavaScript
11
star
49

wasm-fuzzy

Fuzzy match at native speed
C
10
star
50

mycomment.vim

one mapping for comment: <leader>c
Vim Script
10
star
51

coc-extension-codemod

Fix the code of coc.nvim extension.
JavaScript
10
star
52

coc-jedi

Deprecated, use https://github.com/neoclide/coc-python instead.
Python
10
star
53

coc-pyls

Deprecated, use https://github.com/neoclide/coc-python instead.
TypeScript
7
star
54

keep.nvim

Recover removed files made ease for neovim
JavaScript
5
star
55

neoclide-client

Embedding neovim as UI component with unified data flow
JavaScript
3
star
56

tern-neovim

Neovim tern plugin use remote plugin feature
Python
3
star
57

coc-wxml

wxml extension for coc.nvim
TypeScript
3
star
58

neovim-component

Editor component used for neoclide
JavaScript
2
star
59

electron-discuss

Discuss issues with electron
1
star