diff --git a/init.lua b/init.lua index cd55754..56b3abf 100644 --- a/init.lua +++ b/init.lua @@ -547,7 +547,9 @@ mason_lspconfig.setup_handlers { end, } --- [[ Configure LuaSnip ]] +-- [[ Configure nvim-cmp, and LuaSnip ]] +-- See `:help cmp` +local cmp = require 'cmp' local luasnip = require 'luasnip' require('luasnip.loaders.from_vscode').lazy_load() luasnip.config.setup { @@ -566,10 +568,6 @@ require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/my_snippets/"} -- https://www.ejmastnak.com/tutorials/vim-latex/luasnip/#refreshing-snippets-from-a-separate-vim-instance vim.keymap.set('n', 'L', 'lua require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/my_snippets/"})', { desc = 'Reload [L]uaSnippets' }) --- [[ Configure nvim-cmp ]] --- See `:help cmp` -local cmp = require 'cmp' - cmp.setup { snippet = { expand = function(args) @@ -611,6 +609,7 @@ cmp.setup { name = 'buffer', option = { keyword_length = 4, + keyword_pattern = [[\k\+]], }, }, { name = 'luasnip' },