如果 vim 的版本低于所需目标,如何抛出异常? (.vimrc/init.vim)
How to throw exception if version of vim is less than a desired target? (.vimrc/init.vim)
简而言之,有没有办法在两者中都做到这一点 neovim/vim:
if (neovim.version < 0.4.3)
throw "Cannot run script."
endif
有has("nvim-x.y.z")
,在:h has()
和h v:version
下都提到了:
if !has("nvim-0.4.3")
" some error processing
throw "Running under " . (has("nvim") ? "old Neovim" : "Vim")
endif
简而言之,有没有办法在两者中都做到这一点 neovim/vim:
if (neovim.version < 0.4.3)
throw "Cannot run script."
endif
有has("nvim-x.y.z")
,在:h has()
和h v:version
下都提到了:
if !has("nvim-0.4.3")
" some error processing
throw "Running under " . (has("nvim") ? "old Neovim" : "Vim")
endif