small overhaul of nvim

This commit is contained in:
Michael Chalupiak
2026-05-03 18:11:21 -04:00
parent f3817cf484
commit 6b6ec87c90
8 changed files with 160 additions and 228 deletions

View File

@@ -1,66 +1,39 @@
return {
{
'nvim-treesitter/nvim-treesitter',
-- branch = 'main',
'neovim-treesitter/nvim-treesitter',
dependencies = { 'neovim-treesitter/treesitter-parser-registry' },
branch = 'main',
version = false,
lazy = false,
build = ':TSUpdate',
config = function()
require'nvim-treesitter.configs'.setup {
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
}
},
move = {
enable = true,
set_jumps = false,
goto_next_start = {
[']a'] = '@parameter.inner',
},
goto_previous_start = {
['[a'] = '@parameter.inner',
}
},
},
auto_install = true,
highlight = {
enable = true,
},
}
local langs = require'nvim-treesitter'.get_installed('parsers')
vim.api.nvim_create_autocmd('FileType', {
pattern = langs,
callback = function()
vim.treesitter.start() -- highlighting
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' -- folds
vim.wo.foldmethod = 'expr'
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" -- indentation
end,
})
end
},
{
'nvim-treesitter/nvim-treesitter-textobjects',
branch = 'main',
opts = {
select = {
lookahead = true,
}
}
},
-- {
-- 'folke/twilight.nvim',
-- dependencies = {
-- 'nvim-treesitter/nvim-treesitter',
-- },
-- cmd = {
-- 'Twilight',
-- 'TwilightEnable',
-- 'TwilightDisable',
-- },
-- },
-- {
-- 'RRethy/vim-illuminate',
-- event = 'VeryLazy',
-- lazy = false,
-- },
{
'0oAstro/dim.lua',
dependencies = {
'nvim-treesitter/nvim-treesitter',
'neovim-treesitter/nvim-treesitter',
'neovim/nvim-lspconfig'
},
event = 'LspAttach',