Extract treesitter custom parsers into separate module
This commit is contained in:
parent
4caeebcd1b
commit
66984355be
1
init.lua
1
init.lua
|
|
@ -234,6 +234,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
|||
|
||||
require 'custom.beancount'
|
||||
require 'custom.keymaps'
|
||||
require 'custom.treesitter'
|
||||
|
||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
})
|
||||
Loading…
Reference in New Issue