diff --git a/nvim/lua/plugins/lsp/completion.lua b/nvim/lua/plugins/lsp/completion.lua index 8f81ebc..20c8802 100644 --- a/nvim/lua/plugins/lsp/completion.lua +++ b/nvim/lua/plugins/lsp/completion.lua @@ -2,7 +2,7 @@ local trigger_chars_add = { "-", "*", "@", "$" } return { "saghen/blink.cmp", -- optional: provides snippets for the snippet source - dependencies = { "rafamadriz/friendly-snippets" }, + dependencies = { "rafamadriz/friendly-snippets", "L3MON4D3/LuaSnip" }, -- use a release tag to download pre-built binaries version = "1.*", @@ -42,13 +42,23 @@ return { -- (Default) Only show the documentation popup when manually triggered completion = { - documentation = { auto_show = true, auto_show_delay_ms = 500 }, - trigger = {}, + documentation = { + auto_show = true, + auto_show_delay_ms = 500, + }, list = { - cycle = { from_top = true, from_bottom = true }, + cycle = { + from_top = true, + from_bottom = true, + }, selection = { auto_insert = false, }, + auto_brackets = { + kind_resolution = { + blocked_filetypes = { "typescriptreact", "javascriptreact", "vue", "latex", "tex" }, + }, + }, }, ghost_text = { enabled = true, @@ -80,6 +90,13 @@ return { }, }, + snippets = { + preset = "luasnip", + opts = { + clipboard_register = nil, + }, + }, + -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` diff --git a/nvim/lua/plugins/lsp/lspconfig.lua b/nvim/lua/plugins/lsp/lspconfig.lua index e2e73c5..c2f2c55 100755 --- a/nvim/lua/plugins/lsp/lspconfig.lua +++ b/nvim/lua/plugins/lsp/lspconfig.lua @@ -17,6 +17,13 @@ return { vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) end + local luasnip = require("luasnip") + + -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) + require("luasnip.loaders.from_vscode").lazy_load() + require("luasnip.loaders.from_vscode").load({ paths = { "~/.config/nvim/snippets" } }) + luasnip.setup({}) + -- ─────────────────────────────────────────────────────────────────── -- ╭───────────────────────────────────────────────╮ -- │ Import configs from other files │