comparison .chezmoitemplates/init.lua @ 496:8524c1a304a6

Enable tree-sitter highlights for systemverilog
author zegervdv <zegervdv@me.com>
date Fri, 03 Dec 2021 15:19:59 +0100
parents de0082b2ca38
children 852acbe7ae8e
comparison
equal deleted inserted replaced
495:de0082b2ca38 496:8524c1a304a6
300 'nvim-treesitter/nvim-treesitter', 300 'nvim-treesitter/nvim-treesitter',
301 config = function() 301 config = function()
302 require 'nvim-treesitter.highlight' 302 require 'nvim-treesitter.highlight'
303 303
304 require('nvim-treesitter.configs').setup { 304 require('nvim-treesitter.configs').setup {
305 highlight = { enable = false }, 305 highlight = {
306 enable = true,
307 disable = function(lang, bufnr)
308 -- Only enable for verilog/systemverilog
309 -- And disable for large files
310 if (lang ~= 'systemverilog' and lang ~= 'verilog') or vim.api.nvim_buf_line_count(bufnr) > 5000 then
311 return true
312 end
313 return false
314 end,
315 },
306 incremental_selection = { 316 incremental_selection = {
307 enable = true, 317 enable = true,
308 keymaps = { 318 keymaps = {
309 init_selection = 'gnn', 319 init_selection = 'gnn',
310 node_incremental = 'grn', 320 node_incremental = 'grn',