Saghen / blink.cmp

Performant, batteries-included completion plugin for Neovim
MIT License
631 stars 26 forks source link

keymap overrides not working (accept, snippet_forward, snippet_backward) #60

Closed themastersheep closed 1 day ago

themastersheep commented 1 day ago

Overridden the keymap as follows, but find the behaviour of forward and back stops working.

keymap = { accept = '', snippet_forward = '', snippet_backward = '', },

When using the defaults, also noted that forwards/backwards functionality is lost once a single value has been entered.

MagicDuck commented 1 day ago

I noticed that yesterday, not sure if it's the same, but for me it was cause the plugin does not bind snippet_forward and snippet_backward in insert mode. So I had to add those bindings myself (I use <end> and <home> for snippets jumping):

  {
    'garymjr/nvim-snippets',
    keys = {
      {
        '<end>',
        function()
          if vim.snippet.active({ direction = 1 }) then
            vim.schedule(function()
              vim.snippet.jump(1)
            end)
            return
          end
          return '<end>'
        end,
        expr = true,
        silent = true,
        mode = 'i',
      },
      {
        '<end>',
        function()
          vim.schedule(function()
            vim.snippet.jump(1)
          end)
        end,
        expr = true,
        silent = true,
        mode = 's',
      },
      {
        '<home>',
        function()
          if vim.snippet.active({ direction = -1 }) then
            vim.schedule(function()
              vim.snippet.jump(-1)
            end)
            return
          end
          return '<home>'
        end,
        expr = true,
        silent = true,
        mode = { 'i', 's' },
      },
    },
  },
Saghen commented 1 day ago

Closed by https://github.com/Saghen/blink.cmp/commit/a89ae200840de7661eb92d8ae202b279ecc56da9