aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.config/nvim
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2023-04-15 00:22:09 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2023-04-20 00:56:51 +0300
commit35d8da7b83442acafbe4349534d28c4f170d88e4 (patch)
tree79b23b1f988b708bf845d205e6c4f6762b61baa9 /dotfiles/.config/nvim
parentba4562e933b5193178720b996c5b9e238cca01cf (diff)
downloadvimrice-35d8da7b83442acafbe4349534d28c4f170d88e4.tar.gz
vimrice-35d8da7b83442acafbe4349534d28c4f170d88e4.zip
Treesitter configuration
Neovim 0.9 uses treesitter by default so I'm making the switch. * treesitter syntax highlight configuration * color palette changes.
Diffstat (limited to 'dotfiles/.config/nvim')
-rw-r--r--dotfiles/.config/nvim/init.vim14
1 files changed, 13 insertions, 1 deletions
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 <silent> ]g <cmd>lua vim.diagnostic.goto_next()<CR>
nmap <silent> [g <cmd>lua vim.diagnostic.goto_prev()<CR>
+" 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 <silent> <leader>gn <cmd>:Over<CR>
nmap <silent> <leader>gs <cmd>:Step<CR>