aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2022-06-28 00:23:53 +0800
committerjdhao <jdhao@hotmail.com>2022-06-28 00:23:53 +0800
commit6dfaf2c521efaa7bd1689a9ebc03a6f43b71cc7d (patch)
tree1e15221cdcc910795a06ff39af21b6d8565af4b7
parentae759477c7fa0cc4fcbaacc1a8eabb45ae95976d (diff)
minor tweak: version checking
-rw-r--r--init.vim7
1 files changed, 5 insertions, 2 deletions
diff --git a/init.vim b/init.vim
index c57d70a..52a648f 100644
--- a/init.vim
+++ b/init.vim
@@ -9,8 +9,11 @@
" Blog: https://jdhao.github.io/
" check if we have the lastest stable version of nvim
-if !has('nvim-0.7.2')
- echohl Error | echomsg "Nvim 0.7.2 required, but is missing!" | echohl None
+let s:expect_ver = printf('nvim-%s', '0.7.2')
+let s:actual_ver = matchstr(execute('version'), 'NVIM v\zs[^\n]*')
+
+if !has(s:expect_ver)
+ echohl Error | echomsg printf("%s required, but got nvim %s!", s:expect_ver, s:actual_ver) | echohl None
finish
endif