From cd82ce16d306aec47a128849290dab74b3598763 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Mon, 13 Apr 2026 06:01:46 +0800 Subject: make nvim init.vim more compatible with vim --- home/xyz/.config/nvim/init.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'home/xyz') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 36e26156..04bbe4ca 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -116,8 +116,10 @@ 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' + endif augroup END " :h markdown, for vim default tpope/vim-markdown @@ -217,6 +219,9 @@ map * /\*\*.*\*\* " toggle markdown folding and re-edit current file map m :call Md_toggle_fold() +" 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 " -- cgit v1.3