Xinqi Bao's Git
projects
/
dotfiles.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
vimrc: new plugin, majutsushi/tagbar, airblade/vim-gitgutter
[dotfiles.git]
/
.config
/
nvim
/
init.vim
diff --git
a/.config/nvim/init.vim
b/.config/nvim/init.vim
index
ecc9745
..
927f94b
100644
(file)
--- a/
.config/nvim/init.vim
+++ b/
.config/nvim/init.vim
@@
-79,9
+79,12
@@
call plug#begin()
Plug 'mbbill/undotree'
Plug 'preservim/nerdtree'
Plug 'mbbill/undotree'
Plug 'preservim/nerdtree'
+ Plug 'majutsushi/tagbar'
+
Plug 'plasticboy/vim-markdown'
Plug 'tpope/vim-fugitive'
Plug 'plasticboy/vim-markdown'
Plug 'tpope/vim-fugitive'
+ Plug 'airblade/vim-gitgutter'
Plug 'kdheepak/lazygit.nvim'
"Plug 'ycm-core/YouCompleteMe'
Plug 'kdheepak/lazygit.nvim'
"Plug 'ycm-core/YouCompleteMe'
@@
-128,7
+131,7
@@
endif
" undotree setting
"----------------------
if has_key(plugs, 'undotree')
" undotree setting
"----------------------
if has_key(plugs, 'undotree')
- nnoremap <leader>u :Undotree
Show
<CR>
+ nnoremap <leader>u :Undotree
Toggle
<CR>
endif
"----------------------
endif
"----------------------
@@
-141,6
+144,13
@@
if has_key(plugs, 'nerdtree')
nnoremap <leader>n :NERDTreeToggle<CR>
endif
nnoremap <leader>n :NERDTreeToggle<CR>
endif
+"----------------------
+" tagbar setting
+"----------------------
+if has_key(plugs, 'tagbar')
+ nnoremap <leader>t :TagbarToggle<CR>
+endif
+
"----------------------
" YouCompleteMe setting
"----------------------
"----------------------
" YouCompleteMe setting
"----------------------
@@
-182,6
+192,9
@@
if has_key(plugs, "coc.nvim")
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
+ " Apply AutoFix to problem on the current line.
+ nmap <leader>qf <Plug>(coc-fix-current)
+
" clangd
nmap <leader>gh :CocCommand clangd.switchSourceHeader<CR>
" clangd
nmap <leader>gh :CocCommand clangd.switchSourceHeader<CR>
@@
-196,6
+209,18
@@
if has_key(plugs, "coc.nvim")
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
+
+ let g:coc_default_semantic_highlight_groups = 1
+ let g:coc_global_extensions = [
+ \'coc-marketplace',
+ \'coc-highlight',
+ \'coc-clangd',
+ \'coc-jedi',
+ \'coc-vimlsp',
+ \'coc-sh',
+ \'coc-json',
+ \'coc-yaml'
+ \]
endif
"----------------------
endif
"----------------------
@@
-203,6
+228,10
@@
endif
"----------------------
if has_key(plugs, 'nvim-treesitter')
lua require('plugin-config/nvim-treesitter')
"----------------------
if has_key(plugs, 'nvim-treesitter')
lua require('plugin-config/nvim-treesitter')
+
+ set foldmethod=expr
+ set foldexpr=nvim_treesitter#foldexpr()
+ set foldlevel=99
endif
endif