VonHeikemen/fine-cmdline.nvim

Integration with nvim-cmp

VonHeikemen opened this issue · 3 comments

I'm afraid that's not possible right now. The problem is cmp-cmdline only works in commandline-mode.

The solution to this is to make cmp-cmdline work in a normal buffer. So... you (not me) would need to create a new nvim-cmp source that has the same features as cmp-cmdline.

Let's imagine you already created this new source, here is what you'll do to make it work (in theory).

local cmp = require('cmp')

require('fine-cmdline').setup({
  cmdline = {
    enable_keymaps = false
  },
  hooks = {
    after_mount = function(input)
      cmp.setup.buffer({
        sources = {
          {name = 'new-imaginary-source'}
        }
      })
    end,
    set_keymaps = function(imap, feedkeys)
      local fn = require('fine-cmdline').fn
 
      -- Restore default keybindings...
      imap('<Esc>', fn.close)
      imap('<C-c>', fn.close)

      imap('<Up>', fn.up_search_history)
      imap('<Down>', fn.down_search_history)
    end
  }
})

It's a very important feature

So... Any updates on this? 👋 😃

So... Any updates on this? wave smiley

Nope. No one has taken the time to create the source for nvim-cmp that is needed.