Skip to content

Commit

Permalink
neovim: disable tree-sitter highlighting in large files
Browse files Browse the repository at this point in the history
  • Loading branch information
adomixaszvers committed Dec 20, 2024
1 parent 7bc8a81 commit 9ee64ab
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions profiles/cli/neovim/nvim-treesitter.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
require'nvim-treesitter.configs'.setup {
require 'nvim-treesitter.configs'.setup {
highlight = {
enable = true, -- false will disable the whole extension
enable = true, -- false will disable the whole extension
-- disable = { "bash" },
is_supported = function()
if vim.fn.strwidth(vim.fn.getline('.')) > 300
or vim.fn.getfsize(vim.fn.expand('%')) > 1024 * 1024 then
return false
else
return true
end
end,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<leader>gn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
init_selection = "<leader>gn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
}

0 comments on commit 9ee64ab

Please sign in to comment.