From 07de246f77191f8d39d87b6f4d9b9946ea9adec3 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Tue, 8 Feb 2022 12:55:24 +0100 Subject: [PATCH] Feat: activate treesitter --- nvim/.config/nvim/lua/completion.lua | 31 +++++++-------------- nvim/.config/nvim/lua/config/treesitter.lua | 6 ++-- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/nvim/.config/nvim/lua/completion.lua b/nvim/.config/nvim/lua/completion.lua index 668a7e3..245bfd7 100644 --- a/nvim/.config/nvim/lua/completion.lua +++ b/nvim/.config/nvim/lua/completion.lua @@ -66,32 +66,21 @@ cmp.setup{ mapping = { -- [""] = cmp.mapping.confirm({select = true, behavior = cmp.ConfirmBehavior.Replace}), [""] = cmp.mapping.confirm({select = true, behavior = cmp.ConfirmBehavior.Insert}), - -- [""] = cmp.mapping(function(fallback) - -- if vim.fn.pumvisible() == 1 then - -- feedkey("", "n") - -- elseif vim.fn["vsnip#available"]() == 1 then - -- feedkey("(vsnip-expand-or-jump)", "") - -- elseif has_words_before() then - -- cmp.complete() - -- else - -- fallback() -- The fallback function sends a already mapped key. In this case, it's probably ``. - -- end - -- end, { "i", "s" }), - - -- [""] = cmp.mapping(function() - -- if vim.fn.pumvisible() == 1 then - -- feedkey("", "n") - -- elseif vim.fn["vsnip#jumpable"](-1) == 1 then - -- feedkey("(vsnip-jump-prev)", "") - -- end - -- end, { "i", "s" }), }, sources = { { name = 'vsnip' }, { name = 'nvim_lsp' }, { name = 'path' }, - { name = 'buffer', keyword_length = 4 }, - { name = 'spell', keyword_length = 4 }, + { + name = 'buffer', + keyword_length = 4, + keyword_pattern = [[\d\@!\k\k*]], + options = { + -- keyword_pattern = [[\k\+]]-- for non ascii caracters + keyword_pattern = [[\d\@!\k\k*]], + } + }, + -- { name = 'spell', keyword_length = 4 }, }, experimental = { -- I like the new menu better! Nice work hrsh7th diff --git a/nvim/.config/nvim/lua/config/treesitter.lua b/nvim/.config/nvim/lua/config/treesitter.lua index 6be6a09..e59e2df 100644 --- a/nvim/.config/nvim/lua/config/treesitter.lua +++ b/nvim/.config/nvim/lua/config/treesitter.lua @@ -5,8 +5,8 @@ require'nvim-treesitter.configs'.setup { enable = true, }, indent = { - enable = true, + enable = false, } } -vim.opt.foldmethod = "expr" -vim.opt.foldexpr = "nvim_treesitter#foldexpr()" +-- vim.opt.foldmethod = "expr" +-- vim.opt.foldexpr = "nvim_treesitter#foldexpr()"