From 4e960a2614accbdbddf0facf90779b54d39ede91 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') diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index bc124ca1..2be62cfe 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -112,8 +112,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 @@ -213,6 +215,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