comparison .chezmoitemplates/init.lua @ 525:f01585f1517f

Enable tree-sitter for some languages
author zegervdv <zegervdv@me.com>
date Tue, 11 Jan 2022 14:59:49 +0100
parents 8d0846b75095
children 793a6f9bc2cf
comparison
equal deleted inserted replaced
524:8d0846b75095 525:f01585f1517f
364 'nvim-treesitter/nvim-treesitter', 364 'nvim-treesitter/nvim-treesitter',
365 config = function() 365 config = function()
366 require 'nvim-treesitter.highlight' 366 require 'nvim-treesitter.highlight'
367 367
368 require('nvim-treesitter.configs').setup { 368 require('nvim-treesitter.configs').setup {
369 ensure_installed = {
370 'python',
371 'lua',
372 'verilog',
373 'json',
374 'yaml',
375 'bash',
376 'dockerfile',
377 'c',
378 'cpp',
379 'regex',
380 'vim',
381 },
369 indent = { 382 indent = {
370 enable = false, 383 enable = false,
371 }, 384 },
372 highlight = { 385 highlight = {
373 enable = false, 386 enable = true,
374 disable = function(lang, bufnr) 387 disable = { 'systemverilog', 'verilog' },
375 -- Only enable for verilog/systemverilog
376 -- And disable for large files
377 if (lang ~= 'systemverilog' and lang ~= 'verilog') or vim.api.nvim_buf_line_count(bufnr) > 5000 then
378 return true
379 end
380 return false
381 end,
382 }, 388 },
383 incremental_selection = { 389 incremental_selection = {
384 enable = true, 390 enable = true,
385 keymaps = { 391 keymaps = {
386 init_selection = 'gnn', 392 init_selection = 'gnn',