diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index ee57e64..210f564 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -92,6 +92,7 @@ with final.pkgs.lib; let nvim-lspconfig # Coding + blink-cmp friendly-snippets lexima-vim (mkNvimPlugin inputs.neotab-nvim "neotab.nvim") diff --git a/nvim/lua/plugins/coding/blink-cmp.lua b/nvim/lua/plugins/coding/blink-cmp.lua new file mode 100644 index 0000000..e72f78c --- /dev/null +++ b/nvim/lua/plugins/coding/blink-cmp.lua @@ -0,0 +1,62 @@ +return { + 'blink.cmp', + event = 'InsertEnter', + before = function() + require('lz.n').trigger_load({ 'mini.icons' }) + end, + after = function() + ---@module 'blink.cmp' + ---@type blink.cmp.Config + local opts = { + appearance = { + use_nvim_cmp_as_default = false, + nerd_font_variant = 'mono', + }, + completion = { + accept = { + auto_brackets = { + enabled = true, + }, + }, + menu = { + draw = { + treesitter = { 'lsp' }, + components = { + kind_icon = { + ellipsis = false, + text = function(ctx) + local icon, _, _ = require('mini.icons').get('lsp', ctx.kind) + return icon + end, + highlight = function(ctx) + local _, hl, _ = require('mini.icons').get('lsp', ctx.kind) + return hl + end, + }, + }, + }, + }, + documentation = { + auto_show = true, + auto_show_delay_ms = 200, + }, + ghost_text = { + enabled = false, + }, + list = { + selection = 'manual', + }, + }, + + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer', 'luasnip' }, + }, + + keymap = { + preset = 'super-tab', + }, + } + + require('blink.cmp').setup(opts) + end, +} diff --git a/nvim/lua/plugins/coding/init.lua b/nvim/lua/plugins/coding/init.lua index 3313ca1..4b986d7 100644 --- a/nvim/lua/plugins/coding/init.lua +++ b/nvim/lua/plugins/coding/init.lua @@ -1,6 +1,7 @@ local req = MarleyVim.local_require('plugins.coding') return { + req('blink-cmp'), req('friendly-snippets'), req('lexima-vim'), req('neotab-nvim'),