mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 11:00:05 +08:00
Add version api
This commit is contained in:
parent
9dc5f917c9
commit
4b62f0511b
@ -3,6 +3,7 @@ function! SpaceVim#api#vim#compatible#get() abort
|
|||||||
\ 'execute' : '',
|
\ 'execute' : '',
|
||||||
\ 'system' : '',
|
\ 'system' : '',
|
||||||
\ 'systemlist' : '',
|
\ 'systemlist' : '',
|
||||||
|
\ 'version' : '',
|
||||||
\ 'globpath' : '',
|
\ 'globpath' : '',
|
||||||
\ },
|
\ },
|
||||||
\ "function('s:' . v:key)"
|
\ "function('s:' . v:key)"
|
||||||
@ -86,4 +87,20 @@ else
|
|||||||
endfunction
|
endfunction
|
||||||
endif
|
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:
|
" vim:set et sw=2 cc=80:
|
||||||
|
Loading…
Reference in New Issue
Block a user