From 1351bd7d4ef69b38593e9967de7f6a12c6cc01f1 Mon Sep 17 00:00:00 2001 From: Xinqi Bao Date: Fri, 2 Oct 2026 18:16:06 +0800 Subject: [PATCH] feat(nvim): expand Tree-sitter parser baseline --- .../lua/plugin-config/nvim-treesitter.lua | 21 ++++++++++++++++++- README.md | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugin-config/nvim-treesitter.lua b/.config/nvim/lua/plugin-config/nvim-treesitter.lua index 9f160e3..4d17d51 100644 --- a/.config/nvim/lua/plugin-config/nvim-treesitter.lua +++ b/.config/nvim/lua/plugin-config/nvim-treesitter.lua @@ -1,7 +1,26 @@ -require('nvim-treesitter').setup { +local treesitter = require('nvim-treesitter') + +treesitter.setup { install_dir = vim.fn.stdpath('data') .. '/site', } +treesitter.install { + 'bash', + 'c', + 'cmake', + 'cpp', + 'json', + 'lua', + 'markdown', + 'markdown_inline', + 'python', + 'query', + 'toml', + 'vim', + 'vimdoc', + 'yaml', +} + local function enable(buf) if not pcall(vim.treesitter.start, buf) then return diff --git a/README.md b/README.md index add4ff7..4d3ef82 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ Link or copy the relevant files into place, or merge them with existing settings Optional: [install mise](https://mise.jdx.dev/getting-started.html), link or copy its configuration to `$HOME/.config/mise/config.toml`, then run `mise install` from `$HOME`. Bash activates mise when available; installed tools take precedence on `PATH`. Use `mise upgrade` to update them. mise manages selected interactive tools; system packages and project toolchains remain separate. +Neovim installs its parser baseline asynchronously; reopen the buffer after installation. Use `:TSInstall ` for additional parsers and `:TSUpdate` after plugin updates. Installation requires tree-sitter CLI, a C compiler, curl, and tar. + ## Maintenance Prefer each tool's supported commands, APIs, and defaults where they fit the intended workflow. Treat upstream examples as patterns to evaluate against this configuration and environment, not recipes to copy unchanged. Add small local code only for a concrete need. -- 2.20.1