diff --git a/indentLine.vim b/indentLine.vim index a0de21f..2bc6a28 100644 --- a/indentLine.vim +++ b/indentLine.vim @@ -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 " " 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! 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! 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 SetIndentLine() +autocmd BufRead,ColorScheme * call InitColor()