summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Pan <xyz@flylightning.xyz>2026-04-13 06:01:46 +0800
committerXiao Pan <xyz@flylightning.xyz>2026-04-13 06:01:46 +0800
commitcd82ce16d306aec47a128849290dab74b3598763 (patch)
tree238835bf9655fc2217adb4b76055a47cd55de944
parent5d279e8dfc0898f00618a076fc68d756661cf6cf (diff)
make nvim init.vim more compatible with vim
-rw-r--r--home/xyz/.config/nvim/init.vim9
1 files changed, 7 insertions, 2 deletions
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 <leader>* /\*\*.*\*\*<CR>
" toggle markdown folding and re-edit current file
map <leader>m :call Md_toggle_fold()<CR>
+" 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
"