mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 05:50:05 +08:00
Add doc for custom spc func (#4472)
This commit is contained in:
parent
68e123447a
commit
7e33b5e39b
@ -83,6 +83,13 @@ function! s:write_to_config(config) abort
|
|||||||
call writefile(a:config, cf, '')
|
call writefile(a:config, cf, '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
""
|
||||||
|
" The first parameter sets the type of shortcut key,
|
||||||
|
" which can be `nnoremap` or `nmap`, the second parameter is a list of keys,
|
||||||
|
" and the third parameter is an ex command or key binding,
|
||||||
|
" depending on whether the last parameter is true.
|
||||||
|
" The fourth parameter is a short description of this custom key binding.
|
||||||
function! SpaceVim#custom#SPC(m, keys, cmd, desc, is_cmd) abort
|
function! SpaceVim#custom#SPC(m, keys, cmd, desc, is_cmd) abort
|
||||||
call add(g:_spacevim_mappings_space_custom,[a:m, a:keys, a:cmd, a:desc, a:is_cmd])
|
call add(g:_spacevim_mappings_space_custom,[a:m, a:keys, a:cmd, a:desc, a:is_cmd])
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -1382,6 +1382,14 @@ SpaceVim#api#import({name}) *SpaceVim#api#import()*
|
|||||||
Import API base the given {name}, and return the API object. for all
|
Import API base the given {name}, and return the API object. for all
|
||||||
available APIs please check |spacevim-api|
|
available APIs please check |spacevim-api|
|
||||||
|
|
||||||
|
SpaceVim#custom#SPC({m}, {keys}, {cmd}, {desc}, {is_cmd})
|
||||||
|
*SpaceVim#custom#SPC()*
|
||||||
|
The first parameter sets the type of shortcut key, which can be `nnoremap`
|
||||||
|
or `nmap`, the second parameter is a list of keys, and the third parameter
|
||||||
|
is an ex command or key binding, depending on whether the last parameter is
|
||||||
|
true. The fourth parameter is a short description of this custom key
|
||||||
|
binding.
|
||||||
|
|
||||||
SpaceVim#layers#load({layer}) *SpaceVim#layers#load()*
|
SpaceVim#layers#load({layer}) *SpaceVim#layers#load()*
|
||||||
Load the {layer} you want. For all the layers SpaceVim supports, see
|
Load the {layer} you want. For all the layers SpaceVim supports, see
|
||||||
|SpaceVim-layers|. the second argv is the layer variable.
|
|SpaceVim-layers|. the second argv is the layer variable.
|
||||||
|
@ -926,6 +926,10 @@ endfunction
|
|||||||
call SpaceVim#custom#SPC('nnoremap', ['f', 't'], 'echom "hello world"', 'test custom SPC', 1)
|
call SpaceVim#custom#SPC('nnoremap', ['f', 't'], 'echom "hello world"', 'test custom SPC', 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
第一个参数设定快捷键的类型,
|
||||||
|
可以是 `nnoremap` 或者 `nmap`,第二个参数是一个按键列表,
|
||||||
|
第三个参数是一个 ex 命令或者按键,这基于最后一个参数是否为`true`。第四个参数是一个简短的描述。
|
||||||
|
|
||||||
**模糊搜索快捷键**
|
**模糊搜索快捷键**
|
||||||
|
|
||||||
可以通过 `SPC ?` 将当前快捷键罗列出来。然后可以输入快捷键按键字母或者描述,可以模糊匹配并展示结果。
|
可以通过 `SPC ?` 将当前快捷键罗列出来。然后可以输入快捷键按键字母或者描述,可以模糊匹配并展示结果。
|
||||||
|
@ -1002,6 +1002,12 @@ Use `SpaceVim#custom#SPC()` to define custom SPC mappings. For instance:
|
|||||||
call SpaceVim#custom#SPC('nnoremap', ['f', 't'], 'echom "hello world"', 'test custom SPC', 1)
|
call SpaceVim#custom#SPC('nnoremap', ['f', 't'], 'echom "hello world"', 'test custom SPC', 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The first parameter sets the type of shortcut key,
|
||||||
|
which can be `nnoremap` or `nmap`, the second parameter is a list of keys,
|
||||||
|
and the third parameter is an ex command or key binding,
|
||||||
|
depending on whether the last parameter is true.
|
||||||
|
The fourth parameter is a short description of this custom key binding.
|
||||||
|
|
||||||
**Fuzzy find key bindings**
|
**Fuzzy find key bindings**
|
||||||
|
|
||||||
It is possible to search for specific key bindings by pressing `?` in the root of the guide buffer.
|
It is possible to search for specific key bindings by pressing `?` in the root of the guide buffer.
|
||||||
|
Loading…
Reference in New Issue
Block a user