aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2026-09-10 22:19:24 +0200
committerGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2026-09-10 22:19:24 +0200
commit56c07f0ff511d024e4ffea417fef480fa0b5b657 (patch)
tree78fe96312309fb5e9a5de0da0f5ee658e11eed80
parentd7f52c9aaee49f62f9e3a2a410ca21eb5e4b1649 (diff)
downloaddotfiles-56c07f0ff511d024e4ffea417fef480fa0b5b657.tar.gz
dotfiles-56c07f0ff511d024e4ffea417fef480fa0b5b657.tar.bz2
dotfiles-56c07f0ff511d024e4ffea417fef480fa0b5b657.zip
Add treesitter + auto-pairs/auto-tag-closing to Neovim config
Not part of the original vimrc (no auto-pairs plugin existed there) - added per request for PyCharm-like brace/quote/HTML-tag auto-closing. - nvim-treesitter (main branch, the current rewrite) with parsers for the languages already covered by the LSP/plugin setup, plus highlighting enabled generically via vim.treesitter.start() on FileType (a no-op, caught by pcall, for filetypes without a parser). - nvim-autopairs for bracket/quote auto-closing. - nvim-ts-autotag (treesitter-based) for HTML/JSX/similar tag auto-closing and renaming.
-rw-r--r--neovim/.config/nvim/lua/plugins/autopairs.lua23
-rw-r--r--neovim/.config/nvim/lua/plugins/treesitter.lua35
2 files changed, 58 insertions, 0 deletions
diff --git a/neovim/.config/nvim/lua/plugins/autopairs.lua b/neovim/.config/nvim/lua/plugins/autopairs.lua
new file mode 100644
index 0000000..877e570
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/autopairs.lua
@@ -0,0 +1,23 @@
1return {
2 {
3 "windwp/nvim-autopairs",
4 event = "InsertEnter",
5 opts = {},
6 },
7 {
8 "windwp/nvim-ts-autotag",
9 ft = {
10 "html",
11 "xml",
12 "javascript",
13 "javascriptreact",
14 "typescript",
15 "typescriptreact",
16 "vue",
17 "svelte",
18 "php",
19 },
20 dependencies = { "nvim-treesitter/nvim-treesitter" },
21 opts = {},
22 },
23}
diff --git a/neovim/.config/nvim/lua/plugins/treesitter.lua b/neovim/.config/nvim/lua/plugins/treesitter.lua
new file mode 100644
index 0000000..875500f
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/treesitter.lua
@@ -0,0 +1,35 @@
1return {
2 "nvim-treesitter/nvim-treesitter",
3 branch = "main",
4 build = ":TSUpdate",
5 config = function()
6 require("nvim-treesitter").install({
7 "lua",
8 "vim",
9 "vimdoc",
10 "query",
11 "python",
12 "bash",
13 "yaml",
14 "hcl",
15 "terraform",
16 "html",
17 "css",
18 "javascript",
19 "typescript",
20 "tsx",
21 "json",
22 "markdown",
23 "markdown_inline",
24 })
25
26 -- Enable highlighting for any buffer whose filetype has an installed
27 -- parser; vim.treesitter.start() is a no-op (caught by pcall) otherwise.
28 vim.api.nvim_create_autocmd("FileType", {
29 pattern = "*",
30 callback = function()
31 pcall(vim.treesitter.start)
32 end,
33 })
34 end,
35}