Slash command completion for ddc.vim.
Type / at line start or after space to complete Claude Code slash commands.
- Completion triggers when
/is at line start or after a space - Prevents unwanted completion in file paths
- Supports hyphenated command names
- Works with both prefix and fuzzy matching
Using dein.vim
call dein#add('vim-denops/denops.vim')
call dein#add('Shougo/ddc.vim')
call dein#add('Shougo/ddc-matcher_head') " or tani/ddc-fuzzy for fuzzy matching
call dein#add('i9wa4/ddc-source-slash-commands')Using lazy.nvim
{
'i9wa4/ddc-source-slash-commands',
dependencies = {
'vim-denops/denops.vim',
'Shougo/ddc.vim',
'Shougo/ddc-matcher_head', -- or tani/ddc-fuzzy for fuzzy matching
},
}Basic setup
call ddc#custom#patch_global('sources', ['slash_commands'])
call ddc#custom#patch_global('sourceOptions', {
\ 'slash_commands': {
\ 'mark': '[cmd]',
\ 'matchers': ['matcher_head'],
\ 'minAutoCompleteLength': 1,
\ 'isVolatile': v:true,
\ 'forceCompletionPattern': '\/[a-zA-Z0-9_-]*',
\ }})For fuzzy matching, change matchers to matcher_fuzzy.
commandsDir- Default:
~/.config/claude/commands - Directory path containing slash command files
- Default:
extensions- Default:
[".md"] - File extensions to include in completion
- Default:
See :help ddc-source-slash-commands for more options.
MIT License