Skip to content

Commit

Permalink
fix treesitter config
Browse files Browse the repository at this point in the history
Signed-off-by: Takashi Iiguni <[email protected]>
  • Loading branch information
guni1192 committed Jun 10, 2024
1 parent b01b911 commit fdc0ee3
Showing 1 changed file with 53 additions and 46 deletions.
99 changes: 53 additions & 46 deletions nvim/lua/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,54 +81,61 @@ lazy.setup({
-- nvim-treeesitter
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
lazy = vim.fn.argc(-1) == 0,
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
opts = {
highlight = { enable = true },
indent = { enable = true },
ensure_installed = {
"bash",
"c",
"diff",
"go",
"hcl",
"html",
"javascript",
"jsdoc",
"json",
"jsonc",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"rust",
"terraform",
"toml",
"tsx",
"typescript",
"vim",
"vimdoc",
"xml",
"yaml",
},
incremental_selection = {
enable = true,
},
textobjects = {
move = {
run = ":TSUpdate",
-- lazy = vim.fn.argc(-1) == 0,
-- cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
config = function ()
require('nvim-treesitter.configs').setup {
auto_install = true,
sync_install = true,
highlight = {
enable = true,
goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer" },
goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer" },
goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" },
goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" },
additional_vim_regex_highlighting = false,
},
},
},
indent = { enable = true },
ensure_installed = {
"bash",
"c",
"diff",
"go",
"hcl",
"html",
"javascript",
"jsdoc",
"json",
"jsonc",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"rust",
"terraform",
"toml",
"tsx",
"typescript",
"vim",
"vimdoc",
"xml",
"yaml",
},
incremental_selection = {
enable = true,
},
textobjects = {
move = {
enable = true,
goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer" },
goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer" },
goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" },
goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" },
},
},
}
end
},
})

Expand Down

0 comments on commit fdc0ee3

Please sign in to comment.