Add treesitter

This commit is contained in:
2026-03-30 07:01:38 -04:00
parent fba7ae9c65
commit 759c614d5d
2 changed files with 35 additions and 0 deletions

View File

@@ -78,6 +78,7 @@ vim.diagnostic.config({
}) })
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" }) vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
vim.keymap.set("n", "<leader>so", "<CMD>so<CR>")
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" }) vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
vim.keymap.set("n", "K", function() vim.keymap.set("n", "K", function()
@@ -98,6 +99,9 @@ vim.pack.add({
github .. "neogitorg/neogit", github .. "neogitorg/neogit",
github .. "stevearc/conform.nvim", github .. "stevearc/conform.nvim",
{ src = github .. "saghen/blink.cmp", version = vim.version.range("v1.*") }, { src = github .. "saghen/blink.cmp", version = vim.version.range("v1.*") },
github .. "tjdevries/colorbuddy.nvim",
github .. "hgranthorner/ghosttybuddy.nvim",
github .. "nvim-treesitter/nvim-treesitter",
}) })
-- Telescope -- Telescope
@@ -162,3 +166,22 @@ vim.api.nvim_create_autocmd("BufWritePre", {
-- blink.cmp -- blink.cmp
require("blink.cmp").setup() require("blink.cmp").setup()
-- ghosttybuddy
vim.cmd.colorscheme("ghostty")
-- nvim-treesitter
local langs = { "rust", "javascript", "zig", "lua", "vim", "vimdoc" }
require("nvim-treesitter").install(langs)
vim.api.nvim_create_autocmd("FileType", {
pattern = langs,
callback = function()
-- syntax highlighting, provided by Neovim
vim.treesitter.start()
-- folds, provided by Neovim
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.wo.foldmethod = "expr"
-- indentation, provided by nvim-treesitter
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})

View File

@@ -5,10 +5,18 @@
"src": "https://github.com/saghen/blink.cmp", "src": "https://github.com/saghen/blink.cmp",
"version": "1.0.0 - 2.0.0" "version": "1.0.0 - 2.0.0"
}, },
"colorbuddy.nvim": {
"rev": "8b968581e5c19d22a861d5f3fe5dbd83394fa681",
"src": "https://github.com/tjdevries/colorbuddy.nvim"
},
"conform.nvim": { "conform.nvim": {
"rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395", "rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395",
"src": "https://github.com/stevearc/conform.nvim" "src": "https://github.com/stevearc/conform.nvim"
}, },
"ghosttybuddy.nvim": {
"rev": "1aea43228171a123424559002e13a2310c25ec0e",
"src": "https://github.com/hgranthorner/ghosttybuddy.nvim"
},
"gitsigns.nvim": { "gitsigns.nvim": {
"rev": "50c205548d8b037b7ff6378fca6d21146f0b6161", "rev": "50c205548d8b037b7ff6378fca6d21146f0b6161",
"src": "https://github.com/lewis6991/gitsigns.nvim" "src": "https://github.com/lewis6991/gitsigns.nvim"
@@ -25,6 +33,10 @@
"rev": "16812abf0e8d8175155f26143a8504e8253e92b0", "rev": "16812abf0e8d8175155f26143a8504e8253e92b0",
"src": "https://github.com/neovim/nvim-lspconfig" "src": "https://github.com/neovim/nvim-lspconfig"
}, },
"nvim-treesitter": {
"rev": "7caec274fd19c12b55902a5b795100d21531391f",
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
},
"oil.nvim": { "oil.nvim": {
"rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e", "rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e",
"src": "https://github.com/stevearc/oil.nvim" "src": "https://github.com/stevearc/oil.nvim"