From 0790233d1ea38eb37a134e9ca620b2d989a75c80 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Wed, 2 Mar 2022 07:24:22 +0000 Subject: Treesitter support --- init.vim | 1 + treesitter.lua | 16 ++++++++++++++++ vimrc | 1 + 3 files changed, 18 insertions(+) create mode 100644 treesitter.lua diff --git a/init.vim b/init.vim index 3abdcda..71e5cdd 100644 --- a/init.vim +++ b/init.vim @@ -8,6 +8,7 @@ source ~/.vimrc " general if has('nvim-0.6.1') source ~/.vim/lsp.lua + source ~/.vim/treesitter.lua end " scala and metals diff --git a/treesitter.lua b/treesitter.lua new file mode 100644 index 0000000..76665bd --- /dev/null +++ b/treesitter.lua @@ -0,0 +1,16 @@ +-- syntax highlighting via treesitter +-- +-- use :TSInstall to install languages +-- +-- go, scala, c, python, ... +-- +require'nvim-treesitter.configs'.setup { + highlight = { + enable = true, + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, +} diff --git a/vimrc b/vimrc index 8163b26..47e802e 100644 --- a/vimrc +++ b/vimrc @@ -82,6 +82,7 @@ end if has('nvim-0.6.1') " lsp Plug 'neovim/nvim-lspconfig' + Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} end call plug#end() -- cgit v1.2.3