Extract treesitter custom parsers into separate module

This commit is contained in:
hlstwizard 2026-04-07 11:50:50 +08:00
parent 4caeebcd1b
commit 66984355be
2 changed files with 12 additions and 0 deletions

View File

@ -234,6 +234,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
require 'custom.beancount' require 'custom.beancount'
require 'custom.keymaps' require 'custom.keymaps'
require 'custom.treesitter'
-- [[ Install `lazy.nvim` plugin manager ]] -- [[ Install `lazy.nvim` plugin manager ]]
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info

11
lua/custom/treesitter.lua Normal file
View File

@ -0,0 +1,11 @@
local extra_parsers = { 'bicep', 'beancount' }
vim.api.nvim_create_autocmd('User', {
pattern = 'VeryLazy',
once = true,
callback = function()
local ok, treesitter = pcall(require, 'nvim-treesitter')
if not ok then return end
treesitter.install(extra_parsers)
end,
})