nvim: refactor treesitter config

This commit is contained in:
Daniel Lundin 2022-04-19 09:57:02 +02:00
parent 4132f6fabe
commit ab2823910b
2 changed files with 6 additions and 32 deletions

View file

@ -153,19 +153,16 @@ return require('packer').startup(function()
end
}
-- treesitter
use {
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
requires = {
"nvim-treesitter/playground",
"nvim-treesitter/nvim-treesitter-textobjects",
"windwp/nvim-ts-autotag"
},
config = function()
require("dln.treesitter")
vim.wo.foldmethod = "expr"
vim.wo.foldexpr = "nvim_treesitter#foldexpr()"
end
run = ":TSUpdate",
config = function() require("plugins/treesitter") end,
}
use {

View file

@ -1,3 +1,6 @@
vim.wo.foldmethod = "expr"
vim.wo.foldexpr = "nvim_treesitter#foldexpr()"
require("nvim-treesitter.configs").setup {
ensure_installed = "all",
highlight = {
@ -46,32 +49,6 @@ require("nvim-treesitter.configs").setup {
["[M"] = "@class.outer"
}
},
-- select = {
-- enable = true,
-- keymaps = {
-- -- You can use the capture groups defined in textobjects.scm
-- ["af"] = "@function.outer",
-- ["if"] = "@function.inner",
-- ["ac"] = "@class.outer",
-- ["ic"] = "@class.inner",
-- -- Or you can define your own textobjects like this
-- ["iF"] = {
-- python = "(function_definition) @function",
-- cpp = "(function_definition) @function",
-- c = "(function_definition) @function",
-- java = "(method_declaration) @function"
-- }
-- }
-- },
-- swap = {
-- enable = true,
-- swap_next = {
-- ["<leader>l"] = "@parameter.inner"
-- },
-- swap_previous = {
-- ["<leader>h"] = "@parameter.inner"
-- }
-- }
},
--- nvim-ts-autotag ---
autotag = {