From 4b62f0511bc0c03dc3fab1da9651afd471ea6a92 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 31 Dec 2017 22:34:43 +0800 Subject: [PATCH] Add version api --- autoload/SpaceVim/api/vim/compatible.vim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/autoload/SpaceVim/api/vim/compatible.vim b/autoload/SpaceVim/api/vim/compatible.vim index b18e1c760..c82e545fa 100644 --- a/autoload/SpaceVim/api/vim/compatible.vim +++ b/autoload/SpaceVim/api/vim/compatible.vim @@ -3,6 +3,7 @@ function! SpaceVim#api#vim#compatible#get() abort \ 'execute' : '', \ 'system' : '', \ 'systemlist' : '', + \ 'version' : '', \ 'globpath' : '', \ }, \ "function('s:' . v:key)" @@ -86,4 +87,20 @@ else endfunction endif +if has('nvim') + function! s:version() abort + redir => l:msg + silent! execute ':version' + redir END + return matchstr(l:msg,'NVIM v\zs[^\n]*') + endfunction +else + function! s:version() abort + redir => l:msg + silent! execute ':version' + redir END + return matchstr(l:msg,'Included patches: v\zs[^\n]*') + endfunction +endif + " vim:set et sw=2 cc=80: