1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 15:19:12 +08:00

Update doc for statusline (#3665)

This commit is contained in:
Wang Shidong 2020-09-19 16:04:55 +08:00 committed by GitHub
parent a2ae25aac6
commit bdaf308fcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 11 deletions

View File

@ -648,6 +648,24 @@ endfunction
]
```
**自定义板块**
可以使用启动函数添加自定板块,比如:
```vim
function! s:test_section() abort
return 'ok'
endfunction
call SpaceVim#layers#core#statusline#register_sections('test', function('s:test_section'))
```
之后就可以在配置文件中添加 `test` 板块,比如,在状态栏右侧最后添加:
```toml
[options]
statusline_right_sections = ['cursorpos', 'percentage', 'test']
```
### 标签栏
如果只有一个 Tab, Buffers 将被罗列在标签栏上,每一个包含:序号、文件类型图标、文件名。如果有不止一个 Tab, 那么所有 Tab 将被罗列在标签栏上。标签栏上每一个 Tab 或者 Buffer 可通过快捷键 `<Leader> number` 进行快速访问,默认的 `<Leader>``\`

View File

@ -674,17 +674,36 @@ switching between different colorschemes, you may need to set
`custom_color_palette` in your custom configuration file. For example:
```toml
custom_color_palette = [
["#282828", "#a89984", 246, 235],
["#a89984", "#504945", 239, 246],
["#a89984", "#3c3836", 237, 246],
["#665c54", 241],
["#282828", "#83a598", 235, 109],
["#282828", "#fe8019", 235, 208],
["#282828", "#8ec07c", 235, 108],
["#282828", "#689d6a", 235, 72],
["#282828", "#8f3f71", 235, 132],
]
[options]
custom_color_palette = [
["#282828", "#a89984", 246, 235],
["#a89984", "#504945", 239, 246],
["#a89984", "#3c3836", 237, 246],
["#665c54", 241],
["#282828", "#83a598", 235, 109],
["#282828", "#fe8019", 235, 208],
["#282828", "#8ec07c", 235, 108],
["#282828", "#689d6a", 235, 72],
["#282828", "#8f3f71", 235, 132],
]
```
**Custion section**
You can use bootstrap function to add custom section to statusline, for example:
```vim
function! s:test_section() abort
return 'ok'
endfunction
call SpaceVim#layers#core#statusline#register_sections('test', function('s:test_section'))
```
Then, add `test` section to `statusline_right_sections` option:
```toml
[options]
statusline_right_sections = ['cursorpos', 'percentage', 'test']
```
### Tabline