Xinqi Bao's Git

docs: keep readme focused on setup
[dotfiles.git] / .config / nvim / init.vim
index b138edb..0a5fc86 100644 (file)
@@ -33,10 +33,14 @@ set noshowmode
 set wildmenu
 set colorcolumn=120
 highlight ColorColumn ctermbg=0 guibg=lightgrey
 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
 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
 
 " Interaction and persistence
 set mouse=a
@@ -87,7 +91,6 @@ call plug#begin()
     Plug 'zbirenbaum/copilot.lua'
 
     " Git
     Plug 'zbirenbaum/copilot.lua'
 
     " Git
-    Plug 'tpope/vim-fugitive'
     Plug 'lewis6991/gitsigns.nvim'
     Plug 'kdheepak/lazygit.nvim'
 
     Plug 'lewis6991/gitsigns.nvim'
     Plug 'kdheepak/lazygit.nvim'
 
@@ -221,6 +224,12 @@ if has_key(plugs, 'lazygit.nvim')
     nnoremap <silent> <leader>lg :LazyGit<CR>
 endif
 
     nnoremap <silent> <leader>lg :LazyGit<CR>
 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')
 " Optional
 if has_key(plugs, 'avante.nvim')
     lua require('plugin-config/avante')