Clap Providers
- Builtin Providers
- How to Create Your Own Provider
- Disable Auto-Completion Plugin in Clap Input Window
Builtin Providers
Additional requirement means the potential extra tool needed for the particular provider besides the Rust binary maple
.
Command | List | Additional Requirement |
---|---|---|
Clap blines | Lines in the current buffer | none |
Clap buffers | Open buffers | none |
Clap colors | Colorschemes | none |
Clap command | Command | none |
Clap hist: or Clap command_history | Command history | none |
Clap hist/ or Clap search_history | Search history | none |
Clap filetypes | File types | none |
Clap help_tags | Help tags | none |
Clap jumps | Jumps | none |
Clap lines | Lines in the loaded buffers | none |
Clap marks | Marks | none |
Clap maps | Maps | none |
Clap quickfix | Entries of the quickfix list | none |
Clap loclist | Entries of the location list | none |
Clap registers | Registers | none |
Clap yanks | Yank stack of the current vim session | none |
Clap history | Open buffers and v:oldfiles | none |
Clap windows | Windows | none |
Clap providers | List the vim-clap providers | none |
Clap bcommits | Git commits for the current buffer | git |
Clap commits | Git commits | git |
Clap gfiles or Clap git_files | Files managed by git | git |
Clap git_diff_files | Files managed by git and having uncommitted changes | git |
Clap live_grep (deprecated) | Grep using word-regexp matcher | rg |
Clap dumb_jump | Definitions/References using regexp with grep fallback | rg with --pcre2 |
Clap files | Files | none |
Clap filer | Ivy-like file explorer | none |
Clap grep + | Grep using fuzzy matcher | none |
Clap igrep | A combo of filer and grep | none |
Clap tags | Tags in the current buffer | none |
Clap tagfiles | Search existing tagfiles | none |
Clap proj_tags | Tags in the current project | universal-ctags (+json ) |
Clap recent_files | Persistent ordered history of recent files | none |
- The command with a superscript
+
means that it supports multi-selection via Tab. Clap live_grep
is deprecated now,Clap grep
is recommended as the successor.:Clap grep
- Use
:Clap grep --query=<cword>
to grep the word under cursor. - Use
:Clap grep --query=@visual
to grep the visual selection. cwd
will be searched by default, specify the extra paths in the end to search multiple directories.:Clap grep --path ~/.vim/plugged/ale
withcwd
is~/.vim/plugged/vim-clap
will both search vim-clap and ale.
- Use
Send a pull request if certain provider is not listed here.
Global Variables
-
g:clap_layout
: Dict,{ 'width': '67%', 'height': '33%', 'row': '33%', 'col': '17%' }
by default. This variable controls the size and position of vim-clap window. By default, the vim-clap window is placed relative to the currently active window. To make it relative to the whole editor modify this variable as shown below:let g:clap_layout = { 'relative': 'editor' }
-
g:clap_open_action
: Dict,{ 'ctrl-t': 'tab split', 'ctrl-x': 'split', 'ctrl-v': 'vsplit' }
, extra key bindings for opening the selected file in a different way. NOTE: do not define a key binding which is conflicted with the other default bindings of vim-clap, and onlyctrl-*
is supported for now. -
g:clap_provider_alias
: Dict, if you don't want to invoke some clap provider by its id(name), as it's too long or somehow, you can add an alias for that provider." The provider name is `command_history`, with the following alias config, " now you can call it via both `:Clap command_history` and `:Clap hist:`. let g:clap_provider_alias = {'hist:': 'command_history'}
-
g:clap_selected_sign
: Dict,{ 'text': ' >', 'texthl': "ClapSelectedSign", "linehl": "ClapSelected"}
. -
g:clap_current_selection_sign
: Dict,{ 'text': '>>', 'texthl': "ClapCurrentSelectionSign", "linehl": "ClapCurrentSelection"}
. -
g:clap_no_matches_msg
: String,'NO MATCHES FOUND'
, message to show when there is no matches found. -
g:clap_popup_input_delay
: Number,200ms
by default, delay for actually responding to the input, vim only. -
g:clap_disable_run_rooter
: Bool,v:false
, vim-clap by default will try to run from the project root by changingcwd
temporarily. Set it tov:true
to run from the origincwd
. The project root here means the git base directory. Create an issue if you want to see more support about the project root.
The option naming convention for provider is g:clap_provider_{provider_id}_{opt}
.
-
g:clap_provider_grep_blink
: [2, 100] by default, blink 2 times with 100ms timeout when jumping the result. Set it to [0, 0] to disable the blink. -
g:clap_provider_grep_opts
: An empty string by default, allows you to enable flags such as'--hidden -g "!.git/"'
.
See :help clap-options
for more information.
How to Create Your Own Provider
" `:Clap quick_open` to open some dotfiles quickly.
" `description` is actually optional, but if you want to show this provider
" when you call `:Clap`, the `description` is necessary.
let g:clap_provider_quick_open = {
\ 'source': ['~/.vimrc', '~/.spacevim', '~/.bashrc', '~/.tmux.conf'],
\ 'sink': 'e',
\ 'description': 'Quick open some dotfiles',
\ }
Find more examples at wiki/Examples.
For complete guide about writing a clap provider please see PROVIDER.md.
Disable Auto-Completion Plugin in Clap Input Window
Some of the auto-completion engines need to turn off to prevent bizarre behaviors(#580)
For nvim-completion, add autocmd to your init.vim:
autocmd FileType clap_input let g:completion_enable_auto_pop = 0
For nvim-compe:
autocmd FileType clap_input call compe#setup({ 'enabled': v:false }, 0)
Configuration
Project-specific ignore config
Ignore the results from the certain files/folders.
[provider.project-ignores."~/src/github.com/bitcoin/bitcoin"]
ignore-file-path-pattern = ["test"]
ignore-file-name-pattern = ["test"]