diff --git a/roles/neovim/files/lua/plugins.lua b/roles/neovim/files/lua/plugins.lua index b70c142..08a8f1c 100644 --- a/roles/neovim/files/lua/plugins.lua +++ b/roles/neovim/files/lua/plugins.lua @@ -30,4 +30,13 @@ return require('packer').startup(function() "MunifTanjim/nui.nvim", } } + + -- Syntax highlighting + use { + 'nvim-treesitter/nvim-treesitter', + run = function() + local ts_update = require('nvim-treesitter.install').update({ with_sync = true }) + ts_update() + end, + } end) diff --git a/roles/neovim/files/plugin/treesitter.lua b/roles/neovim/files/plugin/treesitter.lua new file mode 100644 index 0000000..6938673 --- /dev/null +++ b/roles/neovim/files/plugin/treesitter.lua @@ -0,0 +1,13 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the four listed parsers should always be installed) + ensure_installed = { "c", "lua", "vim", "help", "hcl" }, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = false, + + highlight = { + -- `false` will disable the whole extension + enable = true, + }, +}