Xinqi Bao's Git

feat(nvim): expand Tree-sitter parser baseline
authorXinqi Bao <[email protected]>
Fri, 2 Oct 2026 10:16:06 +0000 (18:16 +0800)
committerXinqi Bao <[email protected]>
Fri, 2 Oct 2026 10:16:06 +0000 (18:16 +0800)
.config/nvim/lua/plugin-config/nvim-treesitter.lua
README.md

index 9f160e3..4d17d51 100644 (file)
@@ -1,7 +1,26 @@
-require('nvim-treesitter').setup {
+local treesitter = require('nvim-treesitter')
+
+treesitter.setup {
   install_dir = vim.fn.stdpath('data') .. '/site',
 }
 
   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
 local function enable(buf)
   if not pcall(vim.treesitter.start, buf) then
     return
index add4ff7..4d3ef82 100644 (file)
--- 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.
 
 
 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 <language>` 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.
 ## 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.