nvim: refactor treesitter config
This commit is contained in:
parent
4132f6fabe
commit
ab2823910b
2 changed files with 6 additions and 32 deletions
|
@ -153,19 +153,16 @@ return require('packer').startup(function()
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- treesitter
|
||||||
use {
|
use {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
run = ":TSUpdate",
|
|
||||||
requires = {
|
requires = {
|
||||||
"nvim-treesitter/playground",
|
"nvim-treesitter/playground",
|
||||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
"windwp/nvim-ts-autotag"
|
"windwp/nvim-ts-autotag"
|
||||||
},
|
},
|
||||||
config = function()
|
run = ":TSUpdate",
|
||||||
require("dln.treesitter")
|
config = function() require("plugins/treesitter") end,
|
||||||
vim.wo.foldmethod = "expr"
|
|
||||||
vim.wo.foldexpr = "nvim_treesitter#foldexpr()"
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
use {
|
use {
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
vim.wo.foldmethod = "expr"
|
||||||
|
vim.wo.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
|
|
||||||
require("nvim-treesitter.configs").setup {
|
require("nvim-treesitter.configs").setup {
|
||||||
ensure_installed = "all",
|
ensure_installed = "all",
|
||||||
highlight = {
|
highlight = {
|
||||||
|
@ -46,32 +49,6 @@ require("nvim-treesitter.configs").setup {
|
||||||
["[M"] = "@class.outer"
|
["[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 ---
|
--- nvim-ts-autotag ---
|
||||||
autotag = {
|
autotag = {
|
Loading…
Reference in a new issue