-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
neovim: disable tree-sitter highlighting in large files
- Loading branch information
1 parent
7bc8a81
commit 9ee64ab
Showing
1 changed file
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
}, | ||
}, | ||
} |