mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-04-15 08:09:11 +08:00
Add mapping for toggle ~ end of buffer
This commit is contained in:
parent
4101110193
commit
d2d7e8d341
@ -48,20 +48,23 @@ function! SpaceVim#layers#ui#config() abort
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['T', 'm'], 'call call('
|
||||
\ . string(s:_function('s:toggle_menu_bar')) . ', [])',
|
||||
\ 'menu-bar', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['T', '~'], 'call call('
|
||||
\ . string(s:_function('s:toggle_end_of_buffer')) . ', [])',
|
||||
\ 'menu-bar', 1)
|
||||
endfunction
|
||||
" function() wrapper
|
||||
if v:version > 703 || v:version == 703 && has('patch1170')
|
||||
function! s:_function(fstr) abort
|
||||
return function(a:fstr)
|
||||
endfunction
|
||||
function! s:_function(fstr) abort
|
||||
return function(a:fstr)
|
||||
endfunction
|
||||
else
|
||||
function! s:_SID() abort
|
||||
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
|
||||
endfunction
|
||||
let s:_s = '<SNR>' . s:_SID() . '_'
|
||||
function! s:_function(fstr) abort
|
||||
return function(substitute(a:fstr, 's:', s:_s, 'g'))
|
||||
endfunction
|
||||
function! s:_SID() abort
|
||||
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$')
|
||||
endfunction
|
||||
let s:_s = '<SNR>' . s:_SID() . '_'
|
||||
function! s:_function(fstr) abort
|
||||
return function(substitute(a:fstr, 's:', s:_s, 'g'))
|
||||
endfunction
|
||||
endif
|
||||
let s:tmflag = 0
|
||||
function! s:toggle_menu_bar() abort
|
||||
@ -117,3 +120,22 @@ function! s:toggle_syntax_hi() abort
|
||||
let s:shflag = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:ebflag = 0
|
||||
function! s:toggle_end_of_buffer() abort
|
||||
if !s:ebflag
|
||||
if &background ==# 'dark'
|
||||
hi EndOfBuffer guibg=#282828
|
||||
else
|
||||
hi EndOfBuffer guibg=#fbf1c7
|
||||
endif
|
||||
let s:ebflag = 1
|
||||
else
|
||||
if &background ==# 'dark'
|
||||
hi EndOfBuffer guibg=#282828 guifg=#282828
|
||||
else
|
||||
hi EndOfBuffer guibg=#fbf1c7 guifg=#fbf1c7
|
||||
endif
|
||||
let s:ebflag = 0
|
||||
endif
|
||||
endfunction
|
||||
|
Loading…
x
Reference in New Issue
Block a user