mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 17:40:06 +08:00
Add: documentation for LangSPCGroupName and LangSPC (#4012)
This commit is contained in:
parent
71754c14ab
commit
267b19fa71
@ -306,7 +306,8 @@ endfunction
|
||||
|
||||
函数 `bootstrap_before` 将在读取用户配置后执行,而函数 `bootstrap_after` 将在 VimEnter autocmd 之后执行。
|
||||
|
||||
如果你需要添加自定义以 `SPC` 为前缀的快捷键,你需要使用 bootstrap function,在其中加入:
|
||||
如果你需要添加自定义以 `SPC` 为前缀的快捷键,你需要使用 bootstrap function,
|
||||
在其中加入以下代码(注意你定义的按键必须是 SpaceVim 没有使用的):
|
||||
|
||||
```vim
|
||||
function! myspacevim#before() abort
|
||||
@ -315,6 +316,18 @@ function! myspacevim#before() abort
|
||||
endfunction
|
||||
```
|
||||
|
||||
同样地,如果你需要定义语言相关的功能,可以使用以下函数定义:
|
||||
|
||||
```vim
|
||||
function! myspacevim#before() abort
|
||||
call SpaceVim#custom#LangSPCGroupName('python', ['G'], '+TestGroup')
|
||||
call SpaceVim#custom#LangSPC('python', 'nore', ['G', 't'], 'echom 1', 'echomessage 1', 1)
|
||||
endfunction
|
||||
```
|
||||
|
||||
这些按键绑定以语言相关的前缀键开头,默认的前缀键是 `,` 。
|
||||
同样,你为特定语言定义的按键必须是 SpaceVim 没有使用的。
|
||||
|
||||
### Vim 兼容模式
|
||||
|
||||
以下为 SpaceVim 中与 Vim 默认情况下的一些差异。
|
||||
|
@ -344,6 +344,17 @@ function! myspacevim#before() abort
|
||||
endfunction
|
||||
```
|
||||
|
||||
Similarly, if you want to add custom key bindings prefixed by language leader key,
|
||||
which is typically `,`, you can add them to the boostrap function. **Be sure** that the
|
||||
key bindings are not used by SpaceVim.
|
||||
|
||||
```vim
|
||||
function! myspacevim#before() abort
|
||||
call SpaceVim#custom#LangSPCGroupName('python', ['G'], '+TestGroup')
|
||||
call SpaceVim#custom#LangSPC('python', 'nore', ['G', 't'], 'echom 1', 'echomessage 1', 1)
|
||||
endfunction
|
||||
```
|
||||
|
||||
### Vim compatible mode
|
||||
|
||||
The different key bindings between SpaceVim and origin vim are shown as below.
|
||||
|
Loading…
Reference in New Issue
Block a user