Zalgorithm

The blink.cmp Neovim plugin

blink.cmp is a Neovim completion plugin. It’s installed and enabled by default on LazyVim .

Docs: https://github.com/saghen/blink.cmp

My blink.cmp configuration #

I toggle completion with “<C + q>”.

It’s configured in ~/.config/nvim/lua/plugins/blink.lua:

return {
  "saghen/blink.cmp",
  opts = function(_, opts)
    local completion_toggle = Snacks.toggle({
      name = "Completion",
      get = function()
        return vim.b.completion
      end,
      set = function(state)
        vim.b.completion = state
      end,
    })

    local function toggle_completion()
      require("blink.cmp").hide()
      completion_toggle:toggle()
    end

    vim.keymap.set({ "i", "n" }, "<C-q>", toggle_completion, { desc = "Toggle Completion" })
    opts.enabled = function()
      return vim.b.completion
    end

    return opts
  end,
}
Tags: