X-Git-Url: https://git.xinqibao.xyz/dotfiles.git/blobdiff_plain/dbc237455efa803b7dfb35e6bcaf79d75130d41e..d3e8cc5876a8246c8fe356311e6b2b9bd22363ad:/.config/nvim/init.vim diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 472bca5..0a5fc86 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -33,10 +33,14 @@ set noshowmode set wildmenu set colorcolumn=120 highlight ColorColumn ctermbg=0 guibg=lightgrey -" Fallback for filetypes without a Tree-sitter parser. -set foldmethod=indent +" Create folds only after a Tree-sitter parser is started. +set foldmethod=expr +set foldexpr=0 set foldlevelstart=99 set foldlevel=99 +" Indent summaries one level past the retained first line, not a continuation. +let &foldtext = 'repeat(" ", indent(v:foldstart - 1) + shiftwidth()) . printf("… %d lines …", v:foldend - v:foldstart + 1)' +set fillchars+=fold:\ " Leave the rest of the summary line blank. " Interaction and persistence set mouse=a @@ -79,8 +83,7 @@ call plug#begin() Plug 'preservim/nerdtree' Plug 'christoomey/vim-tmux-navigator' Plug 'mbbill/undotree' - Plug 'majutsushi/tagbar' - Plug 'ludovicchabant/vim-gutentags' + Plug 'stevearc/aerial.nvim' " Development Plug 'nvim-treesitter/nvim-treesitter' @@ -88,7 +91,6 @@ call plug#begin() Plug 'zbirenbaum/copilot.lua' " Git - Plug 'tpope/vim-fugitive' Plug 'lewis6991/gitsigns.nvim' Plug 'kdheepak/lazygit.nvim' @@ -144,8 +146,9 @@ if has_key(plugs, 'undotree') nnoremap u :UndotreeToggle endif -if has_key(plugs, 'tagbar') - nnoremap t :TagbarToggle +if has_key(plugs, 'aerial.nvim') + lua require('aerial').setup() + nnoremap a AerialToggle! endif " Development @@ -221,6 +224,12 @@ if has_key(plugs, 'lazygit.nvim') nnoremap lg :LazyGit endif +" Markdown +if has_key(plugs, 'markdown-preview.nvim') + let g:mkdp_echo_preview_url = 1 + let g:mkdp_open_to_the_world = 1 +endif + " Optional if has_key(plugs, 'avante.nvim') lua require('plugin-config/avante')