From f24c8e5131795fa7ebefc6e98a394e7260dedfc1 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Sun, 21 Mar 2021 15:13:42 +0200 Subject: [PATCH] [nvim] add nvim-treesitter (READ COMMIT NOTES) The thing is currently unstable, requires the nightly branch of neovim, and the highlighting groups need a lot of tweaking (obviously, :HLT doesn't work, making this even harder). I just put the configuration into the repo in case I need it in the future. --- nvim/dotfiles/plugins-list.vim | 3 +++ nvim/dotfiles/treesitter.vim | 11 +++++++++++ nvim/init.vim | 5 ++++- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 nvim/dotfiles/treesitter.vim diff --git a/nvim/dotfiles/plugins-list.vim b/nvim/dotfiles/plugins-list.vim index 17e70ff..3fa3e77 100644 --- a/nvim/dotfiles/plugins-list.vim +++ b/nvim/dotfiles/plugins-list.vim @@ -64,5 +64,8 @@ Plug 'neoclide/coc.nvim', { 'branch': 'release' } Plug 'dag/vim2hs' Plug 'norcalli/nvim-colorizer.lua' + if g:vim_ide_treesitter + Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' } + endif endif " }}} diff --git a/nvim/dotfiles/treesitter.vim b/nvim/dotfiles/treesitter.vim new file mode 100644 index 0000000..3c0e5e8 --- /dev/null +++ b/nvim/dotfiles/treesitter.vim @@ -0,0 +1,11 @@ +lua <:p:h') let g:vim_ide = get(g:, 'vim_ide', 0) +let g:vim_ide_treesitter = get(g:, 'vim_ide_treesitter', 0) let &runtimepath = g:nvim_dotfiles_dir.','.&runtimepath.','.g:nvim_dotfiles_dir.'/after' @@ -19,6 +20,9 @@ call plug#begin(s:vim_plug_home) Plug 'junegunn/vim-plug' runtime! dotfiles/plugins-list.vim call plug#end() +if g:vim_ide_treesitter + runtime! dotfiles/treesitter.vim +endif " Automatically install/clean plugins (because I'm a programmer) {{{ augroup vimrc-plugins @@ -30,5 +34,4 @@ call plug#end() augroup END " }}} - colorscheme dotfiles