diff --git a/.SpaceVim.d/autoload/SpaceVim/dev/api.vim b/.SpaceVim.d/autoload/SpaceVim/dev/api.vim
new file mode 100644
index 000000000..fb89cb826
--- /dev/null
+++ b/.SpaceVim.d/autoload/SpaceVim/dev/api.vim
@@ -0,0 +1,99 @@
+"=============================================================================
+" api.vim --- Develop script for update api index
+" Copyright (c) 2016-2017 Wang Shidong & Contributors
+" Author: Wang Shidong < wsdjeg at 163.com >
+" URL: https://spacevim.org
+" License: GPLv3
+"=============================================================================
+
+scriptencoding utf-8
+
+function! SpaceVim#dev#api#update() abort
+
+ let [start, end] = s:find_position()
+ if start != 0 && end != 0
+ if end - start > 1
+ exe (start + 1) . ',' . (end - 1) . 'delete'
+ endif
+ call append(start, s:generate_content())
+ silent! Neoformat
+ endif
+
+endfunction
+
+function! SpaceVim#dev#api#updateCn() abort
+
+ let [start, end] = s:find_position_cn()
+ if start != 0 && end != 0
+ if end - start > 1
+ exe (start + 1) . ',' . (end - 1) . 'delete'
+ endif
+ call append(start, s:generate_content_cn())
+ silent! Neoformat
+ endif
+
+endfunction
+
+function! s:find_position() abort
+ let start = search('^$','bwnc')
+ let end = search('^$','bnwc')
+ return sort([start, end])
+endfunction
+
+function! s:find_position_cn() abort
+ let start = search('^$','bwnc')
+ let end = search('^$','bnwc')
+ return sort([start, end])
+endfunction
+
+function! s:generate_content() abort
+ let content = ['', '## Available APIs', '', 'here is the list of all available APIs, and welcome to contribute to SpaceVim.', '']
+ let content += s:layer_list()
+ return content
+endfunction
+
+function! s:generate_content_cn() abort
+ let content = ['', '## 可用 APIs', '']
+ let content += s:layer_list_cn()
+ return content
+endfunction
+
+function! s:layer_list() abort
+ let layers = SpaceVim#util#globpath('~/.SpaceVim/', 'docs/api/**/*.md')
+ let list = [
+ \ '| Name | Description |',
+ \ '| ---------- | ------------ |'
+ \ ]
+ for layer in layers
+ let name = split(layer, '/docs/api/')[1][:-4] . '/'
+ let url = name
+ let content = readfile(layer)
+ if len(content) > 3
+ let line = '| [' . join(split(name, '/'), '#') . '](' . url . ') | ' . content[2][14:-2] . ' | '
+ else
+ let line = '| [' . join(split(name, '/'), '#') . '](' . url . ') | can not find Description |'
+ endif
+ call add(list, line)
+ endfor
+ return list
+endfunction
+
+function! s:layer_list_cn() abort
+ let layers = SpaceVim#util#globpath('~/.SpaceVim/', 'docs/cn/api/**/*.md')
+ let list = [
+ \ '| 名称 | 描述 |',
+ \ '| ---------- | ------------ |'
+ \ ]
+ for layer in layers
+ let name = split(layer, '/docs/cn/api/')[1][:-4] . '/'
+ let url = name
+ let content = readfile(layer)
+ if len(content) > 3
+ let line = '| [' . join(split(name, '/'), '#') . '](' . url . ') | ' . content[2][14:-2] . ' | '
+ else
+ let line = '| [' . join(split(name, '/'), '#') . '](' . url . ') | can not find Description |'
+ endif
+ call add(list, line)
+ endfor
+ return list
+endfunction
diff --git a/autoload/SpaceVim/api/system.vim b/autoload/SpaceVim/api/system.vim
index 53448178d..f2a78ae4a 100644
--- a/autoload/SpaceVim/api/system.vim
+++ b/autoload/SpaceVim/api/system.vim
@@ -14,17 +14,24 @@ let s:system['isLinux'] = has('unix') && !has('macunix') && !has('win32unix')
let s:system['isOSX'] = has('macunix')
+
+" windows, unix, cygwin, mac, linux
+
function! s:name() abort
if s:system.isLinux
- return 'Linux'
+ return 'linux'
elseif s:system.isWindows
- return 'Windows'
+ if has('win32unix')
+ return 'cygwin'
+ else
+ return 'windows'
+ endif
else
- return 'OSX'
+ return 'mac'
endif
endfunction
-let s:system['name'] = function('s:name')
+let s:system['name'] = s:name()
function! s:isDarwin() abort
if exists('s:is_darwin')
diff --git a/autoload/SpaceVim/layers/core.vim b/autoload/SpaceVim/layers/core.vim
index 8eeea5130..9ffb94867 100644
--- a/autoload/SpaceVim/layers/core.vim
+++ b/autoload/SpaceVim/layers/core.vim
@@ -15,7 +15,7 @@ function! SpaceVim#layers#core#plugins() abort
elseif g:spacevim_filemanager ==# 'vimfiler'
call add(plugins, ['Shougo/vimfiler.vim',{'merged' : 0, 'loadconf' : 1 , 'loadconf_before' : 1, 'on_cmd' : ['VimFiler', 'VimFilerBufferDir']}])
call add(plugins, ['Shougo/unite.vim',{ 'merged' : 0 , 'loadconf' : 1}])
- call add(plugins, ['Shougo/vimproc.vim', {'build' : ['make']}])
+ call add(plugins, ['Shougo/vimproc.vim', {'build' : [(executable('gmake') ? 'gmake' : 'make')]}])
endif
call add(plugins, ['benizi/vim-automkdir'])
diff --git a/autoload/SpaceVim/plugins/manager.vim b/autoload/SpaceVim/plugins/manager.vim
index cba9ed3c0..0b9782893 100644
--- a/autoload/SpaceVim/plugins/manager.vim
+++ b/autoload/SpaceVim/plugins/manager.vim
@@ -10,6 +10,7 @@
let s:VIM_CO = SpaceVim#api#import('vim#compatible')
let s:JOB = SpaceVim#api#import('job')
let s:LIST = SpaceVim#api#import('data#list')
+let s:SYS = SpaceVim#api#import('system')
" init values
@@ -110,7 +111,7 @@ function! s:get_uninstalled_plugins() abort
endfunction
-function! SpaceVim#plugins#manager#reinstall(...)
+function! SpaceVim#plugins#manager#reinstall(...) abort
call dein#reinstall(a:1)
endfunction
@@ -448,8 +449,7 @@ function! s:msg_on_build_start(name) abort
endfunction
function! s:get_build_argv(build) abort
- " TODO check os
- return a:build
+ return a:build[s:SYS.name]
endfunction
" + foo.vim: Updating...
if has('nvim')
@@ -643,7 +643,7 @@ else
endi
" Public API: SpaceVim#plugins#manager#terminal {{{
-function! SpaceVim#plugins#manager#terminal()
+function! SpaceVim#plugins#manager#terminal() abort
for id in keys(s:pulling_repos)
call s:JOB.stop(str2nr(id))
endfor
diff --git a/config/functions.vim b/config/functions.vim
index c2603099e..869d747c4 100644
--- a/config/functions.vim
+++ b/config/functions.vim
@@ -9,9 +9,9 @@ function! WINDOWS()
return (has('win16') || has('win32') || has('win64'))
endfunction
function! OnmiConfigForJsp()
- let pos1 = search("","nb",line("w0"))
- let pos2 = search("','nb',line('w0'))
+ let pos2 = search('