Skip to content

Commit 6698435

Browse files
committed
Extract treesitter custom parsers into separate module
1 parent 4caeebc commit 6698435

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
234234

235235
require 'custom.beancount'
236236
require 'custom.keymaps'
237+
require 'custom.treesitter'
237238

238239
-- [[ Install `lazy.nvim` plugin manager ]]
239240
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info

lua/custom/treesitter.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
local extra_parsers = { 'bicep', 'beancount' }
2+
3+
vim.api.nvim_create_autocmd('User', {
4+
pattern = 'VeryLazy',
5+
once = true,
6+
callback = function()
7+
local ok, treesitter = pcall(require, 'nvim-treesitter')
8+
if not ok then return end
9+
treesitter.install(extra_parsers)
10+
end,
11+
})

0 commit comments

Comments
 (0)