From f6dd4078e691458de8bbaa2454422645773267c7 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sat, 21 Jan 2023 21:46:35 -0500 Subject: [PATCH] nvim: install tree-sitter plugin --- src/.config/nvim/init.vim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/.config/nvim/init.vim b/src/.config/nvim/init.vim index deba464..c6b8365 100755 --- a/src/.config/nvim/init.vim +++ b/src/.config/nvim/init.vim @@ -116,4 +116,25 @@ if has('python3') let g:UltiSnipsSnippetDirectories=[$HOME.'/.config/nvim/ultisnips/'] endif +Plug 'nvim-treesitter/nvim-treesitter' + call plug#end() + +lua << EOF +require'nvim-treesitter.configs'.setup { + ensure_installed = { "c", "cpp", "javascript", "python", "vim", "latex" }, + sync_install = false, + auto_install = false, + highlight = { + enable = true, + + disable = function(lang, buf) + local max_filesize = 100 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return true + end + end, + }, +} +EOF