clean config

This commit is contained in:
Harivansh Rathi 2026-02-20 22:34:08 -05:00
parent 1db6db7f92
commit 25aded9685
19 changed files with 468 additions and 852 deletions

View file

@ -1,92 +1,61 @@
return {
-- Treesitter for syntax highlighting and code understanding
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects' },
config = function()
require('nvim-treesitter.configs').setup({
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['ai'] = '@conditional.outer',
['ii'] = '@conditional.inner',
['al'] = '@loop.outer',
['il'] = '@loop.inner',
['ab'] = '@block.outer',
['ib'] = '@block.inner',
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
[']f'] = '@function.outer',
[']c'] = '@class.outer',
[']a'] = '@parameter.inner',
},
goto_next_end = {
[']F'] = '@function.outer',
[']C'] = '@class.outer',
},
goto_previous_start = {
['[f'] = '@function.outer',
['[c'] = '@class.outer',
['[a'] = '@parameter.inner',
},
goto_previous_end = {
['[F'] = '@function.outer',
['[C'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = { ['<leader>sn'] = '@parameter.inner' },
swap_previous = { ['<leader>sp'] = '@parameter.inner' },
},
},
})
end,
},
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"lua",
"vim",
"vimdoc",
"query",
"javascript",
"typescript",
"tsx",
"python",
"html",
"css",
"json",
"yaml",
"markdown",
"markdown_inline",
"bash",
"regex",
},
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["ai"] = "@conditional.outer",
["ii"] = "@conditional.inner",
["al"] = "@loop.outer",
["il"] = "@loop.inner",
["ab"] = "@block.outer",
["ib"] = "@block.inner",
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]f"] = "@function.outer",
["]c"] = "@class.outer",
["]a"] = "@parameter.inner",
},
goto_next_end = {
["]F"] = "@function.outer",
["]C"] = "@class.outer",
},
goto_previous_start = {
["[f"] = "@function.outer",
["[c"] = "@class.outer",
["[a"] = "@parameter.inner",
},
goto_previous_end = {
["[F"] = "@function.outer",
["[C"] = "@class.outer",
},
},
swap = {
enable = true,
swap_next = {
["<leader>sn"] = "@parameter.inner",
},
swap_previous = {
["<leader>sp"] = "@parameter.inner",
},
},
},
})
end,
},
}