Created
September 20, 2013 07:13
-
-
Save violetyk/6634242 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ステータスラインの色 ctermfgがバックの色で、ctermbgがフロントの文字色 | |
highlight StatusLine term=NONE cterm=NONE ctermfg=black ctermbg=white | |
highlight StatusLine term=reverse cterm=reverse ctermfg=blue ctermbg=white | |
" 入力モードの時にステータスラインの色を変える。 | |
let g:hi_insert = 'highlight StatusLine guifg=LightGrey guibg=darkblue gui=none ctermfg=white ctermbg=blue cterm=none' | |
if has('syntax') | |
augroup InsertHook | |
autocmd! | |
autocmd InsertEnter * call s:StatusLine('Enter') | |
autocmd InsertLeave * call s:StatusLine('Leave') | |
augroup END | |
endif | |
let s:slhlcmd = '' | |
function! s:StatusLine(mode) | |
if a:mode == 'Enter' | |
silent! let s:slhlcmd = 'highlight ' . s:GetHighlight('StatusLine') | |
silent exec g:hi_insert | |
else | |
highlight clear StatusLine | |
silent exec s:slhlcmd | |
endif | |
endfunction | |
function! s:GetHighlight(hi) | |
redir => hl | |
exec 'highlight '.a:hi | |
redir END | |
let hl = substitute(hl, '[\r\n]', '', 'g') | |
let hl = substitute(hl, 'xxx', '', '') | |
return hl | |
endfunction | |
" カーソルラインのハイライト。reverseで反転表示。 | |
" highlight CursorLine term=reverse cterm=reverse | |
" カーソル列のハイライト。reverseで反転表示。 | |
" highlight CursorColumn term=reverse cterm=reverse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment