mirror of
https://github.com/Yggdroot/indentLine.git
synced 2025-12-08 04:54:45 +08:00
to show color more comfortable
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
" Script Name: indentLine.vim
|
" Script Name: indentLine.vim
|
||||||
" Version: 1.0.0
|
" Version: 1.0.1
|
||||||
" Last Change: Oct 20, 2012
|
" Last Change: Dec 3, 2012
|
||||||
" Author: Yggdroot <archofortune@gmail.com>
|
" Author: Yggdroot <archofortune@gmail.com>
|
||||||
"
|
"
|
||||||
" Description: To show the indent line
|
" Description: To show the indent line
|
||||||
@@ -10,20 +10,22 @@ if !has("conceal") || exists("g:loaded_indentLine")
|
|||||||
endif
|
endif
|
||||||
let g:loaded_indentLine = 1
|
let g:loaded_indentLine = 1
|
||||||
|
|
||||||
if (has("gui_running"))
|
|
||||||
hi Conceal guifg=grey guibg=bg
|
|
||||||
else
|
|
||||||
hi Conceal ctermfg=8
|
|
||||||
endif
|
|
||||||
|
|
||||||
set conceallevel=2
|
set conceallevel=2
|
||||||
set concealcursor=inc
|
set concealcursor=inc
|
||||||
|
|
||||||
function! SetIndentLine()
|
function! <SID>InitColor()
|
||||||
|
if &bg == 'light'
|
||||||
|
hi Conceal ctermfg=7 ctermbg=NONE guifg=Gray guibg=NONE
|
||||||
|
else
|
||||||
|
hi Conceal ctermfg=8 ctermbg=NONE guifg=DarkGray guibg=NONE
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! <SID>SetIndentLine()
|
||||||
for i in range(&shiftwidth+1, 100, &shiftwidth)
|
for i in range(&shiftwidth+1, 100, &shiftwidth)
|
||||||
exe 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=|'
|
exe 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=|'
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
autocmd BufRead * call SetIndentLine()
|
autocmd BufRead * call <SID>SetIndentLine()
|
||||||
autocmd ColorScheme * hi Conceal guifg=grey guibg=bg ctermfg=8
|
autocmd BufRead,ColorScheme * call <SID>InitColor()
|
||||||
|
|||||||
Reference in New Issue
Block a user