X-Git-Url: https://git.xinqibao.xyz/dotfiles.git/blobdiff_plain/8da52ea9572302f078821aed54f154ae726d00b4..d3e8cc5876a8246c8fe356311e6b2b9bd22363ad:/.config/nvim/init.vim?ds=inline diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index e002a88..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 @@ -220,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')