extra: nvim: Add nvim-treesitter plugin

Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
Christoph Heiss 2023-04-22 15:01:47 +02:00
parent 4c2bc93fe8
commit 2a7a1bbc91
Signed by: c8h4
GPG key ID: 6817E9C75C0785D7
2 changed files with 16 additions and 0 deletions

View file

@ -299,6 +299,8 @@ require('lazy').setup({
vim.opt.shortmess:append('c')
end,
},
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
})
-- Basic things first
@ -311,3 +313,12 @@ vim.cmd.highlight('comment', 'ctermfg=7')
-- Bring modified buffers to attention
vim.cmd['highlight!']('BufferInactiveMod', 'cterm=bold')
vim.cmd['highlight!']('BufferCurrentMod', 'cterm=bold')
-- Install wanted treesitter parsers
local ts_parsers = require('nvim-treesitter.parsers')
local ts_install = require('nvim-treesitter.install')
for _, p in ipairs(utils.WANTED_TREESITTER_PARSERS) do
if not ts_parsers.has_parser(p) then
ts_install.update(p)
end
end

View file

@ -19,4 +19,9 @@ return {
'*/node_modules/*',
'*/tmp/*',
},
WANTED_TREESITTER_PARSERS = {
'lua',
'haskell',
'rust',
},
}