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>
parent
fbd7c83572
commit
0410bd74ec
9
init.lua
9
init.lua
|
@ -547,7 +547,9 @@ mason_lspconfig.setup_handlers {
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- [[ Configure LuaSnip ]]
|
-- [[ Configure nvim-cmp, and LuaSnip ]]
|
||||||
|
-- See `:help cmp`
|
||||||
|
local cmp = require 'cmp'
|
||||||
local luasnip = require 'luasnip'
|
local luasnip = require 'luasnip'
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
luasnip.config.setup {
|
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
|
-- 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' })
|
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 {
|
cmp.setup {
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
|
@ -611,6 +609,7 @@ cmp.setup {
|
||||||
name = 'buffer',
|
name = 'buffer',
|
||||||
option = {
|
option = {
|
||||||
keyword_length = 4,
|
keyword_length = 4,
|
||||||
|
keyword_pattern = [[\k\+]],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ name = 'luasnip' },
|
{ name = 'luasnip' },
|
||||||
|
|
Loading…
Reference in New Issue