aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-03-02 07:24:22 +0000
committerJuan J. Martinez <jjm@usebox.net>2022-05-29 22:57:31 +0100
commit0790233d1ea38eb37a134e9ca620b2d989a75c80 (patch)
tree5c2aaa8222f27dd93a7a52e8beb82521172bed5b
parent0a932e8f8047864d5b901cd1ccf889b67ae3e73f (diff)
downloaddotnvim-0790233d1ea38eb37a134e9ca620b2d989a75c80.tar.gz
dotnvim-0790233d1ea38eb37a134e9ca620b2d989a75c80.zip
Treesitter support
-rw-r--r--init.vim1
-rw-r--r--treesitter.lua16
-rw-r--r--vimrc1
3 files changed, 18 insertions, 0 deletions
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 <lang> 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()