Feat: activate treesitter

This commit is contained in:
Bertrand Benjamin 2022-02-08 12:55:24 +01:00
parent e04c89b57a
commit 07de246f77
2 changed files with 13 additions and 24 deletions

View File

@ -66,32 +66,21 @@ cmp.setup{
mapping = { mapping = {
-- ["<cr>"] = cmp.mapping.confirm({select = true, behavior = cmp.ConfirmBehavior.Replace}), -- ["<cr>"] = cmp.mapping.confirm({select = true, behavior = cmp.ConfirmBehavior.Replace}),
["<Tab>"] = cmp.mapping.confirm({select = true, behavior = cmp.ConfirmBehavior.Insert}), ["<Tab>"] = cmp.mapping.confirm({select = true, behavior = cmp.ConfirmBehavior.Insert}),
-- ["<Tab>"] = cmp.mapping(function(fallback)
-- if vim.fn.pumvisible() == 1 then
-- feedkey("<C-n>", "n")
-- elseif vim.fn["vsnip#available"]() == 1 then
-- feedkey("<Plug>(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 `<Tab>`.
-- end
-- end, { "i", "s" }),
-- ["<S-Tab>"] = cmp.mapping(function()
-- if vim.fn.pumvisible() == 1 then
-- feedkey("<C-p>", "n")
-- elseif vim.fn["vsnip#jumpable"](-1) == 1 then
-- feedkey("<Plug>(vsnip-jump-prev)", "")
-- end
-- end, { "i", "s" }),
}, },
sources = { sources = {
{ name = 'vsnip' }, { name = 'vsnip' },
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'path' }, { 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 = { experimental = {
-- I like the new menu better! Nice work hrsh7th -- I like the new menu better! Nice work hrsh7th

View File

@ -5,8 +5,8 @@ require'nvim-treesitter.configs'.setup {
enable = true, enable = true,
}, },
indent = { indent = {
enable = true, enable = false,
} }
} }
vim.opt.foldmethod = "expr" -- vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()" -- vim.opt.foldexpr = "nvim_treesitter#foldexpr()"