diff --git a/autoload/SpaceVim/api/system.vim b/autoload/SpaceVim/api/system.vim index 9381edf9c..59876fb74 100644 --- a/autoload/SpaceVim/api/system.vim +++ b/autoload/SpaceVim/api/system.vim @@ -7,6 +7,18 @@ let s:system['isLinux'] = has('unix') && !has('macunix') && !has('win32unix') let s:system['isOSX'] = has('macunix') +function! s:name() abort + if s:system.isLinux + return 'Linux' + elseif s:system.isWindows + return 'Windows' + else + return 'OSX' + endif +endfunction + +let s:system['name'] = function('s:name') + function! s:isDarwin() abort if exists('s:is_darwin') return s:is_darwin diff --git a/autoload/SpaceVim/health/environment.vim b/autoload/SpaceVim/health/environment.vim new file mode 100644 index 000000000..e270db7ea --- /dev/null +++ b/autoload/SpaceVim/health/environment.vim @@ -0,0 +1,10 @@ +function! SpaceVim#health#environment#check() abort + let result = ['SpaceVim environment check report:'] + call add(result, 'Current progpath: ' . v:progname . '(' . v:progpath . ')') + call add(result, 'version: ' . v:version) + call add(result, 'OS: ' . SpaceVim#api#import('system').name()) + call add(result, '[shell, shellcmdflag, shellslash]: ' . string([&shell, &shellcmdflag, &shellslash])) + return result +endfunction + +" vim:set et sw=2: