Compare commits

..

4 Commits

Author SHA1 Message Date
3b9aa845ca
Remove treesitter context 2025-05-26 02:55:25 +02:00
76e71ac03f
Update treesitter to main 2025-05-26 02:48:43 +02:00
98d9158287
Neotree show current file on open 2025-05-26 02:00:42 +02:00
47d631ad21
Improve treesitter context 2025-05-26 01:27:15 +02:00
4 changed files with 34 additions and 28 deletions

View File

@ -32,3 +32,15 @@ vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, {
group = cursor_group, group = cursor_group,
pattern = "*", pattern = "*",
}) })
vim.api.nvim_create_autocmd("FileType", {
pattern = require("tools.highlight"),
callback = function()
-- syntax highlighting, provided by Neovim
vim.treesitter.start()
-- folds, provided by Neovim
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
-- indentation, provided by nvim-treesitter
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})

View File

@ -11,7 +11,7 @@ return {
}, },
cmd = { "Neotree" }, cmd = { "Neotree" },
keys = { keys = {
{ "<F2>", "<cmd>Neotree toggle last<cr>", desc = "Open floating Neo-tree window" }, { "<F2>", "<cmd>Neotree toggle reveal<cr>", desc = "Open floating Neo-tree window" },
}, },
-- netrw hijack does not work when lazy loading -- netrw hijack does not work when lazy loading
lazy = false, lazy = false,

View File

@ -4,27 +4,15 @@ return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
dependencies = { dependencies = {
"nvim-treesitter/nvim-treesitter-context", "nvim-treesitter/nvim-treesitter-context",
"nvim-treesitter/nvim-treesitter-textobjects", { "nvim-treesitter/nvim-treesitter-textobjects", branch = "main" },
"windwp/nvim-ts-autotag", "windwp/nvim-ts-autotag",
}, },
lazy = false,
branch = "main",
build = ":TSUpdate",
opts = { opts = {
-- Add languages to be installed here that you want installed for treesitter -- Add languages to be installed here that you want installed for treesitter
ensure_installed = { ensure_installed = require("tools.highlight"),
"c",
"cpp",
"go",
"lua",
"python",
"rust",
"tsx",
"typescript",
"vimdoc",
"vim",
"markdown",
"markdown_inline",
"bash",
"sql",
},
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = true, auto_install = true,
@ -91,15 +79,5 @@ return {
enable = true, enable = true,
}, },
}, },
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
require("nvim-treesitter.install").update({ with_sync = true })
end,
},
{
"nvim-treesitter/nvim-treesitter-context",
opts = {
separator = require("symbols.window").borderchars[3],
},
}, },
} }

View File

@ -0,0 +1,16 @@
return {
"c",
"cpp",
"go",
"lua",
"python",
"rust",
"tsx",
"typescript",
"vimdoc",
"vim",
"markdown",
"markdown_inline",
"bash",
"sql",
}