Skip to content

Commit 0f1807a

Browse files
restrayTimothée Belhomme
authored and
Timothée Belhomme
committed
feat: allow treesitter defaults to be overwritten from custom directory (nvim-lua#732)
1 parent 593824c commit 0f1807a

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

init.lua

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -779,17 +779,18 @@ require('lazy').setup({
779779
{ -- Highlight, edit, and navigate code
780780
'nvim-treesitter/nvim-treesitter',
781781
build = ':TSUpdate',
782-
config = function()
782+
opts = {
783+
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
784+
-- Autoinstall languages that are not installed
785+
auto_install = true,
786+
highlight = { enable = true },
787+
indent = { enable = true },
788+
},
789+
config = function(_, opts)
783790
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
784791

785792
---@diagnostic disable-next-line: missing-fields
786-
require('nvim-treesitter.configs').setup {
787-
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
788-
-- Autoinstall languages that are not installed
789-
auto_install = true,
790-
highlight = { enable = true },
791-
indent = { enable = true },
792-
}
793+
require('nvim-treesitter.configs').setup(opts)
793794

794795
-- There are additional nvim-treesitter modules that you can use to interact
795796
-- with nvim-treesitter. You should go explore a few and see what interests you:

0 commit comments

Comments
 (0)