From 0410bd74ec57541d276a3260933c1ba98f23ac8e Mon Sep 17 00:00:00 2001 From: iGor milhit Date: Fri, 11 Aug 2023 15:41:12 +0200 Subject: [PATCH] completion: support non ascii with cmp-buffer - Supports non ASCII chars in text completion (cmp-buffer). - Restore the luasnip configuration inside the nvim-cmp configuration, as it is indeed closely related. I didn't understood it in the first place. Co-Authored-by: iGor milhit --- init.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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' },