1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 04:50:04 +08:00

Update doc for bootstrap

close #1896
This commit is contained in:
wsdjeg 2018-07-26 21:37:58 +08:00
parent 5030e0f1ad
commit 8d184c60f0
2 changed files with 26 additions and 0 deletions

View File

@ -18,6 +18,7 @@ lang: cn
- [更新插件](#更新插件)
- [获取日志](#获取日志)
- [用户配置](#用户配置)
- [启动函数](#启动函数)
- [Vim 兼容模式](#vim-兼容模式)
- [私有模块](#私有模块)
- [概念](#概念)
@ -199,6 +200,28 @@ call SpaceVim#custom#SPCGroupName(['G'], '+TestGroup')
call SpaceVim#custom#SPC('nore', ['G', 't'], 'echom 1', 'echomessage 1', 1)
```
### 启动函数
由于 toml 配置的局限性SpaceVim 提供了两种启动函数 `bootstrap_before``bootstrap_after`,在该函数内可以使用 Vim script。
可通过设置这两个选项值来指定函数名称。
启动函数文件应防止在 Vim &runtimepath 的 autoload 文件夹内。例如:
文件名: `~/.SpaceVim.d/autoload/myspacevim.vim`
```vim
func! myspacevim#before() abort
let g:neomake_enabled_c_makers = ['clang']
nnoremap jk <esc>
endf
func! myspacevim#after() abort
iunmap jk
endf
```
函数 `bootstrap_before` 将在读取用户配置后执行,而函数 `bootstrap_after` 将在 VimEnter autocmd 之后执行。
### Vim 兼容模式
以下为 SpaceVim 中与 Vim 默认情况下的一些差异,而在兼容模式下,

View File

@ -253,6 +253,9 @@ func! myspacevim#after() abort
endf
```
the `bootstrap_before` will be called after custom configuration file is loaded. and the `bootstrap_after` will
be called after VimEnter autocmd.
### Vim Compatible Mode
This a list of different key bindings between SpaceVim and origin vim. If you still want to use this origin function, you can enable vimcompatible mode, via `vimcompatible = true` in `[options]` section.