1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:20:06 +08:00

feat(major_mode): add wrap line major mode icon

This commit is contained in:
wsdjeg 2022-04-23 16:50:28 +08:00
parent a3031c6b92
commit bfb5444c34
3 changed files with 13 additions and 1 deletions

View File

@ -97,6 +97,11 @@ let s:modes = {
\ 'icon_asc' : 'w',
\ 'desc' : 'whitespace mode',
\ },
\ 'wrapline' :{
\ 'icon' : s:MESSLETTERS.circled_letter('W'),
\ 'icon_asc' : 'W',
\ 'desc' : 'wrap line mode',
\ },
\ }
if SpaceVim#layers#isLoaded('checkers')

View File

@ -275,7 +275,8 @@ function! SpaceVim#layers#ui#config() abort
call SpaceVim#mapping#space#def('nnoremap', ['t', 'l'], 'setlocal list!',
\ 'toggle-hidden-listchars', 1)
call SpaceVim#mapping#space#def('nnoremap', ['t', 'W'], 'setlocal wrap!',
call SpaceVim#mapping#space#def('nnoremap', ['t', 'W'], 'call call('
\ . string(s:_function('s:toggle_wrap_line')) . ', [])',
\ 'toggle-wrap-line', 1)
call SpaceVim#mapping#space#def('nnoremap', ['t', 'w'], 'call call('
\ . string(s:_function('s:toggle_whitespace')) . ', [])',
@ -476,6 +477,11 @@ function! s:toggle_whitespace() abort
call SpaceVim#layers#core#statusline#toggle_mode('whitespace')
endfunction
function! s:toggle_wrap_line() abort
setlocal wrap!
call SpaceVim#layers#core#statusline#toggle_mode('wrapline')
endfunction
function! s:toggle_conceallevel() abort
if &conceallevel == 0
setlocal conceallevel=2

View File

@ -723,6 +723,7 @@ The letters displayed in the statusline correspond to the key bindings used to t
| `SPC t s` | ⓢ | s | syntax checking (neomake) |
| `SPC t S` | Ⓢ | S | enabled in spell checking |
| `SPC t w` | ⓦ | w | whitespace mode (highlight trailing whitespace) |
| `SPC t W` | Ⓦ | W | wrap line mode |
**colorscheme of statusline:**