to show color more comfortable

This commit is contained in:
Yggdroot
2012-12-04 21:51:16 +08:00
parent d0f0274e26
commit efa4a4c7fb

View File

@@ -1,6 +1,6 @@
" Script Name: indentLine.vim
" Version: 1.0.0
" Last Change: Oct 20, 2012
" Version: 1.0.1
" Last Change: Dec 3, 2012
" Author: Yggdroot <archofortune@gmail.com>
"
" Description: To show the indent line
@@ -10,20 +10,22 @@ if !has("conceal") || exists("g:loaded_indentLine")
endif
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 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)
exe 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=|'
endfor
endfunction
autocmd BufRead * call SetIndentLine()
autocmd ColorScheme * hi Conceal guifg=grey guibg=bg ctermfg=8
autocmd BufRead * call <SID>SetIndentLine()
autocmd BufRead,ColorScheme * call <SID>InitColor()