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 <igor@milhit.ch>
iGor milhit 2023-08-11 15:41:12 +02:00
parent fbd7c83572
commit 0410bd74ec
Signed by: igor
GPG Key ID: 692D97C3D0228A99
1 changed files with 4 additions and 5 deletions

View File

@ -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', '<Leader>L', '<Cmd>lua require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/my_snippets/"})<CR>', { 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' },