Using treesitter for syntax highlighting
This commit is contained in:
41
init.vim
41
init.vim
@@ -5,12 +5,17 @@ set cursorline
|
|||||||
set ts=4 sw=4
|
set ts=4 sw=4
|
||||||
|
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
|
"file explorer"
|
||||||
Plug 'preservim/nerdtree'
|
Plug 'preservim/nerdtree'
|
||||||
|
"status line"
|
||||||
Plug 'itchyny/lightline.vim'
|
Plug 'itchyny/lightline.vim'
|
||||||
|
"color themes"
|
||||||
Plug 'gilgigilgil/anderson.vim'
|
Plug 'gilgigilgil/anderson.vim'
|
||||||
Plug 'sainnhe/sonokai'
|
Plug 'sainnhe/sonokai'
|
||||||
Plug 'numirias/semshi', { 'do': ':UpdateRemotePlugins' }
|
"automatic parentheses"
|
||||||
Plug 'bfrg/vim-cpp-modern'
|
Plug 'jiangmiao/auto-pairs'
|
||||||
|
"syntax highlighting"
|
||||||
|
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
|
|
||||||
@@ -46,3 +51,35 @@ let g:airline_powerline_fonts = 1
|
|||||||
let g:sonokai_style = 'shusia'
|
let g:sonokai_style = 'shusia'
|
||||||
let g:sonokai_better_performance = 1
|
let g:sonokai_better_performance = 1
|
||||||
colorscheme sonokai
|
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
|
||||||
Reference in New Issue
Block a user