diff options
Diffstat (limited to 'nvim/.config')
-rw-r--r-- | nvim/.config/nvim/lazy-lock.json | 2 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/tobyvin/plugins/cmp.lua | 21 |
2 files changed, 18 insertions, 5 deletions
diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index fd87a8f..9490c85 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,5 +1,6 @@ { "Comment.nvim": { "branch": "master", "commit": "45dc21a71ad1450606f5e98261badb28db59d74c" }, + "LuaSnip": { "branch": "master", "commit": "5570fd797eae0790affb54ea669a150cad76db5d" }, "SchemaStore.nvim": { "branch": "main", "commit": "f36196d7044da6abf13ed3abf824fd5f3625f35d" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, @@ -13,6 +14,7 @@ "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "d2768cb1b83de649d57d967085fe73c5e01f8fd7" }, "cmp-nvim-lua": { "branch": "main", "commit": "d276254e7198ab7d00f117e88e223b4bd8c02d21" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "crates.nvim": { "branch": "main", "commit": "a70328ae638e20548bcfc64eb9561101104b3008" }, "diffview.nvim": { "branch": "main", "commit": "3812e296d3977a24db62f7c18025755b40968d3a" }, "dressing.nvim": { "branch": "master", "commit": "4436d6f41e2f6b8ada57588acd1a9f8b3d21453c" }, diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/cmp.lua b/nvim/.config/nvim/lua/tobyvin/plugins/cmp.lua index f3aabac..3d7052a 100644 --- a/nvim/.config/nvim/lua/tobyvin/plugins/cmp.lua +++ b/nvim/.config/nvim/lua/tobyvin/plugins/cmp.lua @@ -22,6 +22,13 @@ local M = { dependencies = { "nvim-lua/plenary.nvim" }, config = true, }, + { + "saadparwaiz1/cmp_luasnip", + dependencies = { + "L3MON4D3/LuaSnip", + config = true, + }, + }, }, } @@ -37,12 +44,15 @@ function M.config() and context.in_syntax_group("Comment") end - local enabled = function() - return default.enabled() and not in_comment() - end - cmp.setup.global({ - enabled = enabled, + enabled = function() + return default.enabled() and not in_comment() + end, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, window = { completion = cmp.config.window.bordered({ border = "single" }), documentation = cmp.config.window.bordered({ border = "single" }), @@ -58,6 +68,7 @@ function M.config() sources = { { name = "nvim_lsp" }, { name = "nvim_lsp_signature_help" }, + { name = "luasnip" }, { name = "path" }, }, }) |