From 35d8da7b83442acafbe4349534d28c4f170d88e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Sat, 15 Apr 2023 00:22:09 +0300 Subject: Treesitter configuration Neovim 0.9 uses treesitter by default so I'm making the switch. * treesitter syntax highlight configuration * color palette changes. --- dotfiles/.config/nvim/init.vim | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'dotfiles/.config/nvim') diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim index bda1c52..f4dd3d2 100644 --- a/dotfiles/.config/nvim/init.vim +++ b/dotfiles/.config/nvim/init.vim @@ -28,6 +28,9 @@ call plug#begin('~/.local/share/nvim/site/plugged') Plug 'neovim/nvim-lspconfig' Plug 'ojroques/nvim-lspfuzzy' endif + if has('nvim-0.9') + Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + endif call plug#end() " Some basics: @@ -86,7 +89,7 @@ call plug#end() " Statusline let laststatus=2 set statusline= - set statusline+=%#CursorLineNR# + set statusline+=%#SignColumn# set statusline+=%{StatuslineGit()} set statusline+=%#StatusLine# set statusline+=%< @@ -256,6 +259,15 @@ call plug#end() nmap ]g lua vim.diagnostic.goto_next() nmap [g lua vim.diagnostic.goto_prev() +" Treesitter + if has('nvim-0.9') + " XXX: neovim's built-in C et al treesitter parsers are better, although + " not ideal either. + lua require('nvim-treesitter.configs').setup{ ensure_installed = { "go", "rust", "python", "lua", "comment" }, highlight = { enable = true, disable = { "c", "cpp", "vim", "make" } }} + set foldmethod=expr + set foldexpr=nvim_treesitter#foldexpr() + endif + " Termdebugger keybinds nmap gn :Over nmap gs :Step -- cgit v1.2.3