diff --git a/autoload/SpaceVim/layers/core/statusline.vim b/autoload/SpaceVim/layers/core/statusline.vim index 1f6d08292..6fbb5af50 100644 --- a/autoload/SpaceVim/layers/core/statusline.vim +++ b/autoload/SpaceVim/layers/core/statusline.vim @@ -258,11 +258,20 @@ endfunction function! s:syntax_checking() abort if SpaceVim#lsp#buf_server_ready() let counts = v:lua.require('spacevim.lsp').lsp_diagnostic_count() - let warnings = get(counts, 1, 0) let errors = get(counts, 0, 0) - let l = warnings ? '%#SpaceVim_statusline_warn# ● ' . warnings . ' ' : '' - let l .= errors ? (warnings ? '' : ' ') . '%#SpaceVim_statusline_error#● ' . errors . ' ' : '' - return l + let warnings = get(counts, 1, 0) + let infos = get(counts, 2, 0) + let hints = get(counts, 3, 0) + let errors_l = errors ? '%#SpaceVim_statusline_error#● ' . errors : '' + let warnings_l = warnings ? '%#SpaceVim_statusline_warn#● ' . warnings : '' + let infos_l = infos ? '%#SpaceVim_statusline_info#● ' . infos : '' + let hints_l = hints ? '%#SpaceVim_statusline_hint#● ' . hints : '' + let l = join(filter([errors_l, warnings_l, infos_l, hints_l], 'v:val != ""'), ' ') + if !empty(l) + return ' ' . l . ' ' + else + return '' + endif elseif g:spacevim_lint_engine ==# 'neomake' if !exists('g:loaded_neomake') return '' @@ -736,8 +745,10 @@ function! SpaceVim#layers#core#statusline#def_colors() abort exe 'hi! SpaceVim_statusline_b ctermbg=' . t[1][2] . ' ctermfg=' . t[1][3] . ' guibg=' . t[1][1] . ' guifg=' . t[1][0] exe 'hi! SpaceVim_statusline_c ctermbg=' . t[2][2] . ' ctermfg=' . t[2][3] . ' guibg=' . t[2][1] . ' guifg=' . t[2][0] exe 'hi! SpaceVim_statusline_z ctermbg=' . t[3][1] . ' ctermfg=' . t[2][2] . ' guibg=' . t[3][0] . ' guifg=' . t[2][0] - exe 'hi! SpaceVim_statusline_error ctermbg=' . t[1][2] . ' ctermfg=Black guibg=' . t[1][1] . ' guifg=#fb4934 gui=bold' - exe 'hi! SpaceVim_statusline_warn ctermbg=' . t[1][2] . ' ctermfg=Black guibg=' . t[1][1] . ' guifg=#fabd2f gui=bold' + exe 'hi! SpaceVim_statusline_error ctermbg=' . t[1][2] . ' ctermfg=Black guibg=' . t[1][1] . ' guifg=#ffc0b9 gui=bold' + exe 'hi! SpaceVim_statusline_warn ctermbg=' . t[1][2] . ' ctermfg=Black guibg=' . t[1][1] . ' guifg=#fce094 gui=bold' + exe 'hi! SpaceVim_statusline_info ctermbg=' . t[1][2] . ' ctermfg=Black guibg=' . t[1][1] . ' guifg=#8cf8f7 gui=bold' + exe 'hi! SpaceVim_statusline_hint ctermbg=' . t[1][2] . ' ctermfg=Black guibg=' . t[1][1] . ' guifg=#a6dbff gui=bold' call s:HI.hi_separator('SpaceVim_statusline_a', 'SpaceVim_statusline_b') call s:HI.hi_separator('SpaceVim_statusline_a_bold', 'SpaceVim_statusline_b') call s:HI.hi_separator('SpaceVim_statusline_ia', 'SpaceVim_statusline_b') diff --git a/docs/cn/documentation.md b/docs/cn/documentation.md index 3f9aec6d6..d48a96d18 100644 --- a/docs/cn/documentation.md +++ b/docs/cn/documentation.md @@ -591,6 +591,15 @@ SpaceVim 默认使用 `nerd fonts`,可参阅其安装指南进行安装。 状态栏中语法检查信息元素如果被启用了,当语法检查结束后,会在状态栏中展示当前语法错误和警告的数量。 +错误及警告的默认高亮组名称及颜色为: + +| 高亮组名称 | 颜色 | +| --------------------------- | --------- | +| `SpaceVim_statusline_error` | `#ffc0b9` | +| `SpaceVim_statusline_warn` | `#fce094` | +| `SpaceVim_statusline_info` | `#8cf8f7` | +| `SpaceVim_statusline_hint` | `#a6dbff` | + **搜索结果信息:** 当使用 `/` 或 `?` 进行搜索时,或当按下 `n` 或 `N` 后,搜索结果序号将被展示在状态栏中,使用类似于 `20/22` 这样的分数显示搜索结果的当前序号以及结果总数。具体的效果图如下: diff --git a/docs/documentation.md b/docs/documentation.md index bad9461d3..5047869ae 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -102,7 +102,7 @@ description: "General documentation about how to use SpaceVim, including the qui - **Great documentation:** Everything is documented in `:h SpaceVim`. - **Better experience:** Most of the core plugins have been rewritten using Lua. - **Beautiful UI:** The interface has been carefully designed. -- **Mnemonic key bindings:** Key bindings are organized using mnemonic prefixes. +- **Mnemonic key bindings:** Key bindings are organized using mnemonic prefixes. - **Lower the risk of RSI:** Heavily using the `` key instead of modifiers. ## Screenshots @@ -635,6 +635,15 @@ By default SpaceVim uses nerd-fonts, which can be downloaded from their [website When syntax checking major mode is enabled, a new element appears showing the number of errors and warnings. +The default highlight group and colors are: + +| highlight group | color | +| --------------------------- | --------- | +| `SpaceVim_statusline_error` | `#ffc0b9` | +| `SpaceVim_statusline_warn` | `#fce094` | +| `SpaceVim_statusline_info` | `#8cf8f7` | +| `SpaceVim_statusline_hint` | `#a6dbff` | + **Search index integration:** Search index shows the number of occurrences when performing a search via `/` or `?`.