nvim: install tree-sitter plugin

This commit is contained in:
dogeystamp 2023-01-21 21:46:35 -05:00
parent d878a2cb78
commit f6dd4078e6
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -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