]> git.rmz.io Git - dotfiles.git/commitdiff
lazyvim: absorb blink config
authorSamir Benmendil <me@rmz.io>
Sun, 9 Feb 2025 17:12:17 +0000 (17:12 +0000)
committerSamir Benmendil <me@rmz.io>
Sun, 2 Mar 2025 15:44:14 +0000 (15:44 +0000)
nvim/lua/plugins/blink.lua [new file with mode: 0644]

diff --git a/nvim/lua/plugins/blink.lua b/nvim/lua/plugins/blink.lua
new file mode 100644 (file)
index 0000000..6de3b68
--- /dev/null
@@ -0,0 +1,76 @@
+return {
+  {
+    "saghen/blink.cmp",
+    version = "*",
+    -- build = "cargo build --release",
+    dependencies = {
+      "rafamadriz/friendly-snippets",
+    },
+    -- NOTE: not described in upstream install docs
+    event = "InsertEnter",
+
+    ---@module 'blink.cmp'
+    ---@type blink.cmp.Config
+    opts = {
+      completion = {
+        menu = { draw = { treesitter = { "lsp" }, }, },
+        documentation = {
+          auto_show = true,
+          auto_show_delay_ms = 200,
+        },
+        ghost_text = {
+          enabled = true,
+        },
+      },
+
+      cmdline = {
+        enabled = false,
+      },
+      sources = {
+        default = { "lsp", "path", "snippets", "buffer" },
+      },
+
+      keymap = {
+        preset = "enter",
+        ["<C-y>"] = { "select_and_accept" },
+      },
+    },
+    opts_extend = { "sources.default", },
+  },
+
+  -- add icons
+  {
+    "saghen/blink.cmp",
+    opts = function(_, opts)
+      opts.appearance = opts.appearance or {}
+      opts.appearance.kind_icons = vim.tbl_extend("force", opts.appearance.kind_icons or {}, LazyVim.config.icons.kinds)
+    end,
+  },
+
+  -- lazydev
+  {
+    "saghen/blink.cmp",
+    opts = {
+      sources = {
+        -- add lazydev to your completion providers
+        default = { "lazydev" },
+        providers = {
+          lazydev = {
+            name = "LazyDev",
+            module = "lazydev.integrations.blink",
+            score_offset = 100, -- show at a higher priority than lsp
+          },
+        },
+      },
+    },
+  },
+  -- catppuccin support
+  {
+    "catppuccin",
+    optional = true,
+    opts = {
+      integrations = { blink_cmp = true },
+    },
+  },
+}
+