summaryrefslogtreecommitdiff
path: root/home/xyz/.config/nvim/init.vim
diff options
context:
space:
mode:
Diffstat (limited to 'home/xyz/.config/nvim/init.vim')
-rw-r--r--home/xyz/.config/nvim/init.vim31
1 files changed, 26 insertions, 5 deletions
diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim
index b5c7be08..0fcd4244 100644
--- a/home/xyz/.config/nvim/init.vim
+++ b/home/xyz/.config/nvim/init.vim
@@ -11,7 +11,6 @@ call plug#begin()
if has('nvim') && executable('firefox') && ( hostname() != 'xyzpp' )
Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } }
endif
-" tinted-theming/base16-vim has low contrast on fold title make it unreadable, but I customized it easily
" chriskempson/base16-vim doesn't do bold/italic for markdown syntax, and not maintained
" RRethy/base16-nvim does not highlight markdown codeblocks
" tinted-theming/base16-vim and RRethy/base16-nvim seem both work, both support tree-sitter
@@ -112,8 +111,15 @@ augroup mycmd
" https://github.com/neovim/neovim/pull/25336
" https://github.com/neovim/neovim/commit/29fe883aa9166bdbcae3f935523c75a8aa56fe45
" remove nvim.swapfile autocmd is more correct, without also works but I think it change to 'e' then to 'o' which is not ideal, also it will echo "W325: ..." which is not what I want
- autocmd! nvim.swapfile
- autocmd SwapExists * let v:swapchoice = 'o'
+ if has('nvim')
+ autocmd! nvim.swapfile
+ autocmd SwapExists * let v:swapchoice = 'o'
+ " neovim high CPU usage when editing markdown file with many lines,
+ " e.g., more than 100 lines, can be workarounded with `:lua
+ " vim.treesitter.stop()`
+ " https://github.com/neovim/neovim/discussions/39277
+ autocmd FileType markdown lua vim.treesitter.stop()
+ endif
augroup END
" :h markdown, for vim default tpope/vim-markdown
@@ -213,8 +219,23 @@ map <leader>* /\*\*.*\*\*<CR>
" toggle markdown folding and re-edit current file
map <leader>m :call Md_toggle_fold()<CR>
-" default statusline:set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
-set statusline+=%<
+" Consider vim need `set laststatus=2` to always show status line above
+" command line, vim default to 1, nvim default to 2
+set laststatus=2
+" Default statusline shows in the `:h statusline` first example:
+" set statusline=%<%f\ %h%w%m%r%=%-14.(%l,%c%V%)\ %P
+"
+" nvim `:set statusline?` shows more stuffs, not sure why
+"
+" Before nvim 0.12.1, statusline+=%< as first works, now it needs = instead of
+" += else it will show two statuline. statusline+=%< as first seems still work
+" with new version of vim. It maybe because now nvim `:set statusline?` is not
+" empty but at vim it is empty. Also note `set statusline=` at first will not
+" work for nvim 0.12.1, it will not set statusline as empty, see:
+" https://github.com/neovim/neovim/issues/38670#issuecomment-4168169676
+" https://github.com/neovim/neovim/issues/33576
+" https://github.com/neovim/neovim/pull/33036
+set statusline=%<
set statusline+=%f " %F or 1CTRL+G to show full path
set statusline+=\ %m
set statusline+=%=