mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 01:50:05 +08:00
Add api
This commit is contained in:
parent
084ee3fcc8
commit
3d843a7076
@ -66,7 +66,7 @@ let g:spacevim_vim_plug_installed = 0
|
||||
" >
|
||||
" let g:spacevim_plugin_bundle_dir = '~/.cache/vimplugs'
|
||||
" <
|
||||
let g:spacevim_plugin_bundle_dir = $HOME. join(['', '.cache', 'vimfiles', ''], '/')
|
||||
let g:spacevim_plugin_bundle_dir = $HOME. join(['', '.cache', 'vimfiles', ''], SpaceVim#api#import('file').separator)
|
||||
""
|
||||
" Disable/Enable realtime leader guide, by default it is 0.
|
||||
" to enable this feature:
|
||||
|
8
autoload/SpaceVim/api.vim
Normal file
8
autoload/SpaceVim/api.vim
Normal file
@ -0,0 +1,8 @@
|
||||
function! SpaceVim#api#import(name) abort
|
||||
let p = {}
|
||||
try
|
||||
let p = SpaceVim#api#{a:name}#get()
|
||||
catch /^Vim\%((\a\+)\)\=:E117/
|
||||
endtry
|
||||
return p
|
||||
endfunction
|
15
autoload/SpaceVim/api/file.vim
Normal file
15
autoload/SpaceVim/api/file.vim
Normal file
@ -0,0 +1,15 @@
|
||||
let s:file = {}
|
||||
let s:system = SpaceVim#api#import('system')
|
||||
|
||||
if s:system.isWindows
|
||||
let s:file['separator'] = '\'
|
||||
else
|
||||
let s:file['separator'] = '/'
|
||||
endif
|
||||
|
||||
function! SpaceVim#api#file#get() abort
|
||||
return deepcopy(s:file)
|
||||
endfunction
|
||||
|
||||
|
||||
|
12
autoload/SpaceVim/api/system.vim
Normal file
12
autoload/SpaceVim/api/system.vim
Normal file
@ -0,0 +1,12 @@
|
||||
let s:system = {}
|
||||
|
||||
let s:system['isWindows'] = has('win16') || has('win32') || has('win64')
|
||||
|
||||
let s:system['isLinux'] = has('unix') && !has('macunix') && !has('win32unix')
|
||||
|
||||
let s:system['isOSX'] = has('macunix')
|
||||
|
||||
|
||||
function! SpaceVim#api#system#get() abort
|
||||
return deepcopy(s:system)
|
||||
endfunction
|
Loading…
Reference in New Issue
Block a user