mirror of
https://github.com/osyo-manga/vim-brightest.git
synced 2025-11-14 14:33:52 -05:00
Add :BrightestLock, :BrightestUnlock.
This commit is contained in:
@@ -41,7 +41,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:is_enable_in_current(context)
|
function! s:is_enable_in_current(context)
|
||||||
let default = get(g:brightest#enable_filetypes, "_", 1)
|
let default = get(g:brightest#enable_filetypes, "_", 1)
|
||||||
return g:brightest_enable && get(g:brightest#enable_filetypes, a:context.filetype, default)
|
return get(g:brightest#enable_filetypes, a:context.filetype, default)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,12 @@
|
|||||||
:BrightestClear *:BrightestClear*
|
:BrightestClear *:BrightestClear*
|
||||||
ハイライトを削除します。
|
ハイライトを削除します。
|
||||||
|
|
||||||
|
:BrightestLock *:BrightestLock*
|
||||||
|
現在でのバッファで brightest を無効にします。
|
||||||
|
|
||||||
|
:BrightestUnlock *:BrightestUnlock*
|
||||||
|
|:BrightestLock| で無効にしたのを戻します。
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
設定 *brightest-setting*
|
設定 *brightest-setting*
|
||||||
|
|
||||||
|
|||||||
@@ -24,12 +24,19 @@ command! -bar BrightestHighlight call brightest#highlighting()
|
|||||||
command! -bar BrightestClear call brightest#hl_clear()
|
command! -bar BrightestClear call brightest#hl_clear()
|
||||||
command! -bar BrightestEnable let g:brightest_enable = 1 | BrightestHighlight
|
command! -bar BrightestEnable let g:brightest_enable = 1 | BrightestHighlight
|
||||||
command! -bar BrightestDisable let g:brightest_enable = 0 | BrightestClear
|
command! -bar BrightestDisable let g:brightest_enable = 0 | BrightestClear
|
||||||
|
command! -bar BrightestUnlock let b:brightest_enable = 1 | BrightestHighlight
|
||||||
|
command! -bar BrightestLock let b:brightest_enable = 0 | BrightestClear
|
||||||
|
|
||||||
|
|
||||||
|
function! s:highlight()
|
||||||
|
if g:brightest_enable && get(b:, "brightest_enable", 1)
|
||||||
|
call brightest#highlighting()
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
augroup brightest
|
augroup brightest
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd CursorMoved * call brightest#highlighting()
|
autocmd CursorMoved * call s:highlight()
|
||||||
autocmd BufLeave,WinLeave,InsertEnter * call brightest#hl_clear()
|
autocmd BufLeave,WinLeave,InsertEnter * call brightest#hl_clear()
|
||||||
autocmd ColorScheme * call s:init_hl()
|
autocmd ColorScheme * call s:init_hl()
|
||||||
augroup END
|
augroup END
|
||||||
|
|||||||
Reference in New Issue
Block a user