Skip to content

hrsh7th/cmp-cmdline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cmp-cmdline

nvim-cmp source for vim's cmdline.

Setup

Completions for / search based on current buffer:

    -- `/` cmdline setup.
    cmp.setup.cmdline('/', {
      mapping = cmp.mapping.preset.cmdline(),
      sources = {
        { name = 'buffer' }
      }
    })

Completions for command mode:

    -- `:` 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 is needed.

Option

ignore_cmds: string[]

Default: { "Man", "!" }

You can specify ignore command name.

treat_trailing_slash: boolean

Default: true

vim.fn.getcompletion can return path items. unfortunately, that items has trailing slash so we don't narrowing with next directory with pressing /.

if you turnd on this option, cmp-cmdline removes trailing slash automatically.

About

nvim-cmp source for vim's cmdline

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages