Using treesitter for syntax highlighting

This commit is contained in:
2025-04-19 11:41:34 +00:00
parent 4f2a72a73e
commit 11798bd693

View File

@@ -5,12 +5,17 @@ set cursorline
set ts=4 sw=4
call plug#begin()
"file explorer"
Plug 'preservim/nerdtree'
"status line"
Plug 'itchyny/lightline.vim'
"color themes"
Plug 'gilgigilgil/anderson.vim'
Plug 'sainnhe/sonokai'
Plug 'numirias/semshi', { 'do': ':UpdateRemotePlugins' }
Plug 'bfrg/vim-cpp-modern'
"automatic parentheses"
Plug 'jiangmiao/auto-pairs'
"syntax highlighting"
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
call plug#end()
@@ -46,3 +51,35 @@ let g:airline_powerline_fonts = 1
let g:sonokai_style = 'shusia'
let g:sonokai_better_performance = 1
colorscheme sonokai
lua << EOF
require'nvim-treesitter.configs'.setup {
-- Install parsers for languages you use
ensure_installed = { "c", "cpp", "python", "lua", "vim", "go" },
-- Install all maintained parsers
-- ensure_installed = "all",
-- Syntax highlighting
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
-- Indentation based on treesitter (experimental)
indent = {
enable = true
},
-- Incremental selection based on the syntax tree
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
}
EOF