From 483e3c0e2979032990e5b689ba33655ae32a2b82 Mon Sep 17 00:00:00 2001 From: Shidong Wang Date: Sat, 25 Sep 2021 21:09:11 +0800 Subject: [PATCH] change(core): deprecate `statusline_unicode_symbols` option Problem: the option name is too long Solution: change `statusline_unicode_symbols` to `statusline_unicode` --- autoload/SpaceVim.vim | 8 ++++---- autoload/SpaceVim/layers/VersionControl.vim | 4 ++-- autoload/SpaceVim/layers/core/statusline.vim | 10 +++++----- doc/SpaceVim.txt | 11 +++++------ docs/cn/documentation.md | 2 +- docs/documentation.md | 2 +- mode/basic.toml | 2 +- 7 files changed, 19 insertions(+), 20 deletions(-) diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index a82e81663..2f5c658c5 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -578,21 +578,21 @@ let g:spacevim_statusline_left_sections = ['winnr', 'filename', 'major mode', let g:spacevim_statusline_right_sections = ['fileformat', 'cursorpos', 'percentage'] "" -" @section statusline_unicode_symbols, options-statusline_unicode_symbols +" @section statusline_unicode, options-statusline_unicode " @parentsection options " Enable/Disable unicode symbols in statusline, includes the mode icons and " fileformat icons. This option is enabled by default, to disable it: " > -" statusline_unicode_symbols = false +" statusline_unicode = false " < "" " Enable/Disable unicode symbols in statusline, includes the mode icons and " fileformat icons. This option is enabled by default, to disable it: " > -" let g:spacevim_statusline_unicode_symbols = 0 +" let g:spacevim_statusline_unicode = 0 " < -let g:spacevim_statusline_unicode_symbols = 1 +let g:spacevim_statusline_unicode = 1 "" " Enable/Disable language specific leader, by default you can use `,` ket " instead of `SPC` `l`. diff --git a/autoload/SpaceVim/layers/VersionControl.vim b/autoload/SpaceVim/layers/VersionControl.vim index b62eed440..39a4930a7 100644 --- a/autoload/SpaceVim/layers/VersionControl.vim +++ b/autoload/SpaceVim/layers/VersionControl.vim @@ -70,7 +70,7 @@ function! s:git_branch() abort call fugitive#detect(getcwd()) let head = fugitive#head() endif - if g:spacevim_statusline_unicode_symbols == 1 + if g:spacevim_statusline_unicode == 1 return empty(head) ? '' : '  '.head . ' ' . s:gtm_status() else return empty(head) ? '' : ' '.head . ' ' . s:gtm_status() @@ -80,7 +80,7 @@ function! s:git_branch() abort elseif exists('g:loaded_git') try let head = '%{git#branch#current()}' - if g:spacevim_statusline_unicode_symbols == 1 + if g:spacevim_statusline_unicode == 1 return empty(head) ? '' : '  '.head . ' ' . s:gtm_status() else return empty(head) ? '' : ' '.head . ' ' . s:gtm_status() diff --git a/autoload/SpaceVim/layers/core/statusline.vim b/autoload/SpaceVim/layers/core/statusline.vim index 9411a9adf..11fbce754 100644 --- a/autoload/SpaceVim/layers/core/statusline.vim +++ b/autoload/SpaceVim/layers/core/statusline.vim @@ -142,7 +142,7 @@ function! s:filename() abort endfunction function! s:fileformat() abort - if g:spacevim_statusline_unicode_symbols == 1 + if g:spacevim_statusline_unicode == 1 let g:_spacevim_statusline_fileformat = s:SYSTEM.fileformat() else let g:_spacevim_statusline_fileformat = &ff @@ -156,13 +156,13 @@ function! s:major_mode() abort endfunction function! s:modes() abort - if g:spacevim_statusline_unicode_symbols + if g:spacevim_statusline_unicode let m = ' ❖ ' else let m = ' # ' endif for mode in s:loaded_modes - if g:spacevim_statusline_unicode_symbols + if g:spacevim_statusline_unicode let m .= s:modes[mode].icon . ' ' else let m .= s:modes[mode].icon_asc . ' ' @@ -202,14 +202,14 @@ endfunction function! s:battery_status() abort if executable('acpi') let battery = split(system('acpi'))[-1][:-2] - if g:spacevim_statusline_unicode_symbols + if g:spacevim_statusline_unicode return ' ' . s:ICON.battery_status(battery) . ' ' else return ' ⚡' . battery . ' ' endif elseif executable('pmset') let battery = matchstr(system('pmset -g batt'), '\d\+%')[:-2] - if g:spacevim_statusline_unicode_symbols + if g:spacevim_statusline_unicode return ' ' . s:ICON.battery_status(battery) . ' ' else return ' ⚡' . battery . ' ' diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index ddd4f5d70..ae4ba0568 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -69,8 +69,7 @@ CONTENTS *SpaceVim-contents* 49. statusline_iseparator.......|SpaceVim-options-statusline_iseparator| 50. statusline_left_sections.|SpaceVim-options-statusline_left_sections| 51. statusline_separator.........|SpaceVim-options-statusline_separator| - 52. statusline_unicode_symbols -.................................|SpaceVim-options-statusline_unicode_symbols| + 52. statusline_unicode.............|SpaceVim-options-statusline_unicode| 53. terminal_cursor_shape.......|SpaceVim-options-terminal_cursor_shape| 54. vim_help_language...............|SpaceVim-options-vim_help_language| 55. vimcompatible.......................|SpaceVim-options-vimcompatible| @@ -699,12 +698,12 @@ See more details in: http://spacevim.org/documentation/#statusline ============================================================================== -STATUSLINE_UNICODE_SYMBOLS *SpaceVim-options-statusline_unicode_symbols* +STATUSLINE_UNICODE *SpaceVim-options-statusline_unicode* Enable/Disable unicode symbols in statusline, includes the mode icons and fileformat icons. This option is enabled by default, to disable it: > - statusline_unicode_symbols = false + statusline_unicode = false < ============================================================================== @@ -1010,11 +1009,11 @@ Define the right section of statusline in active windows. By default: \ ] < - *g:spacevim_statusline_unicode_symbols* + *g:spacevim_statusline_unicode* Enable/Disable unicode symbols in statusline, includes the mode icons and fileformat icons. This option is enabled by default, to disable it: > - let g:spacevim_statusline_unicode_symbols = 0 + let g:spacevim_statusline_unicode = 0 < *g:spacevim_enable_language_specific_leader* diff --git a/docs/cn/documentation.md b/docs/cn/documentation.md index 0e2320750..d7b7a926c 100644 --- a/docs/cn/documentation.md +++ b/docs/cn/documentation.md @@ -621,7 +621,7 @@ SpaceVim 所支持的分割符以及截图如下: **SpaceVim 功能模块:** -功能模块可以通过 `SPC t m m` 快捷键显示或者隐藏。默认使用 Unicode 字符,可通过设置 `statusline_unicode_symbols = false` 来启用 ASCII 字符。(或许在终端中无法设置合适的字体时,可使用这一选项)。 +功能模块可以通过 `SPC t m m` 快捷键显示或者隐藏。默认使用 Unicode 字符,可通过设置 `statusline_unicode = false` 来启用 ASCII 字符。(或许在终端中无法设置合适的字体时,可使用这一选项)。 状态栏中功能模块内的字符显示与否,同如下快捷键功能保持一致: diff --git a/docs/documentation.md b/docs/documentation.md index 781f2f6cb..68a654c04 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -681,7 +681,7 @@ Here is an exhaustive set of screenshots for all the available separators: The minor mode area can be toggled on and off with `SPC t m m`. -Unicode symbols are displayed by default. Add `statusline_unicode_symbols = false` to your custom configuration file to use ASCII characters instead (may be useful in the terminal if you cannot set an appropriate font). +Unicode symbols are displayed by default. Add `statusline_unicode = false` to your custom configuration file to use ASCII characters instead (may be useful in the terminal if you cannot set an appropriate font). The letters displayed in the statusline correspond to the key bindings used to toggle them. diff --git a/mode/basic.toml b/mode/basic.toml index b72533f78..f1095d0eb 100644 --- a/mode/basic.toml +++ b/mode/basic.toml @@ -24,7 +24,7 @@ windows_index_type = 3 enable_tabline_filetype_icon = false enable_statusline_mode = false - statusline_unicode_symbols = false + statusline_unicode = false # Enable vim compatible mode, avoid changing origin vim key bindings vimcompatible = true