nvim: install tree-sitter plugin
This commit is contained in:
parent
d878a2cb78
commit
f6dd4078e6
@ -116,4 +116,25 @@ if has('python3')
|
|||||||
let g:UltiSnipsSnippetDirectories=[$HOME.'/.config/nvim/ultisnips/']
|
let g:UltiSnipsSnippetDirectories=[$HOME.'/.config/nvim/ultisnips/']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Plug 'nvim-treesitter/nvim-treesitter'
|
||||||
|
|
||||||
call plug#end()
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user