diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index 95014c686..a4b6f5505 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -53,8 +53,9 @@ function! SpaceVim#layers#ui#config() abort call SpaceVim#mapping#space#def('nnoremap', ['t', '8'], 'call call(' \ . string(s:_function('s:toggle_fill_column')) . ', [])', \ 'highlight-long-lines', 1) - call SpaceVim#mapping#space#def('nnoremap', ['t', 'b'], 'call ToggleBG()', - \ 'toggle background', 1) + call SpaceVim#mapping#space#def('nnoremap', ['t', 'b'], 'call call(' + \ . string(s:_function('s:toggle_background')) . ', [])', + \ 'toggle conceal', 1) call SpaceVim#mapping#space#def('nnoremap', ['t', 'c'], 'call call(' \ . string(s:_function('s:toggle_conceal')) . ', [])', \ 'toggle conceal', 1) @@ -281,3 +282,13 @@ func! s:toggle_conceal() setlocal conceallevel=0 endif endf + +function! s:toggle_background() + let s:tbg = &background + " Inversion + if s:tbg ==# 'dark' + set background=light + else + set background=dark + endif +endfunction diff --git a/config/functions.vim b/config/functions.vim index 10529e07d..e7b40f1ad 100644 --- a/config/functions.vim +++ b/config/functions.vim @@ -11,15 +11,6 @@ function! OnmiConfigForJsp() return "\a." endif endf -function! ToggleBG() - let s:tbg = &background - " Inversion - if s:tbg ==# 'dark' - set background=light - else - set background=dark - endif -endfunction function! BracketsFunc() let line = getline('.') let col = col('.')