commit af93492c8ef4a21a9b15c78f1d9c9a19c34c692c
parent c2d4befbfd57b284369dfff16ce6bf6b6faae030
Author: Chris Bracken <chris@bracken.jp>
Date: Fri, 22 May 2026 06:52:56 +0900
nvim: add treesitter plugin remove rust/zig plugins
Adding treesitter with rust, swift, zig support means we no longer need
dedicated plugins for those languages.
Diffstat:
2 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/.config/nvim/after/ftplugin/md.lua b/.config/nvim/after/ftplugin/md.lua
@@ -0,0 +1,6 @@
+vim.opt_local.tabstop = 2
+vim.opt_local.shiftwidth = 2
+vim.opt_local.softtabstop = 2
+vim.opt_local.expandtab = true
+vim.opt_local.colorcolumn = "100"
+vim.opt_local.textwidth = 100
diff --git a/.config/nvim/lua/plugins/languages.lua b/.config/nvim/lua/plugins/languages.lua
@@ -115,7 +115,31 @@ return {
})
end,
},
- { "rhysd/vim-clang-format" },
- { "rust-lang/rust.vim" },
- { "ziglang/zig.vim" },
+ {
+ "nvim-treesitter/nvim-treesitter",
+ build = ":TSUpdate",
+ init = function()
+ vim.api.nvim_create_autocmd("FileType", {
+ desc = "Automatically start Tree-sitter highlighting if a parser is available",
+ callback = function(args)
+ local lang = vim.treesitter.language.get_lang(args.match)
+ if not lang then return end
+
+ local parser = vim.treesitter.get_parser(args.buf, lang)
+ if not parser then return end
+
+ vim.treesitter.start(args.buf, lang)
+ end,
+ })
+ end,
+ config = function()
+ require("nvim-treesitter").install({
+ -- Bash, C, C++, Markdown, Lua, Markdown, Python supported by default.
+ "rust",
+ "swift",
+ "zig",
+ })
+ end,
+ },
}
+