1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 06:30:03 +08:00
SpaceVim/bundle/cmp-cmdline/README.md

46 lines
838 B
Markdown
Raw Normal View History

# cmp-cmdline
nvim-cmp source for vim's cmdline.
# Setup
2023-06-09 12:10:07 +08:00
Completions for `/` search based on current buffer:
```lua
2023-06-09 12:10:07 +08:00
-- `/` cmdline setup.
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
```
2023-06-09 12:10:07 +08:00
Completions for command mode:
```lua
-- `:` cmdline setup.
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{
name = 'cmdline',
option = {
ignore_cmds = { 'Man', '!' }
}
}
})
})
```
For the buffer source to work, [cmp-buffer](https://github.com/hrsh7th/cmp-buffer) is needed.
# Option
### ignore_cmds: string[]
Default: `{ "Man", "!" }`
You can specify ignore command name.