mirror of
https://github.com/Yggdroot/indentLine.git
synced 2025-12-06 20:24:28 +08:00
correct bug that "tty color setting override term color setting".
This commit is contained in:
@@ -15,7 +15,7 @@ If you use a plugin manager you can put the whole directory into your `~/.vim/bu
|
||||
You can change the color of indentLines:
|
||||
for Vim, set `g:indentLine_color_term` in your `.vimrc`, e.g. `let g:indentLine_color_term = 239`,
|
||||
for GVim, set `g:indentLine_color_gui` in your `.vimrc`, e.g. `let g:indentLine_color_gui = '#A4E57E'`
|
||||
for none X terminal, set `g:indentLine_color_tty` in your `.vimrc`, e.g. `let g:indentLine_color_tty = 2
|
||||
for none X terminal, set `g:indentLine_color_tty_light` and `g:indentLine_color_tty_dark` in your `.vimrc`. e.g. `let g:indentLine_color_tty_light = 7`(default: 4), `let g:indentLine_color_dark = 1`(default: 2).
|
||||
|
||||
You can also change the indentLine char:
|
||||
for both Vim and GVim, set `let g:indentLine_char = 'c'` where `'c'` can be any ASCII character. You can also use one of `¦`, `┆` or `│` to display more beautiful lines. However, these characters will only work with files whose encoding is UTF-8.
|
||||
|
||||
@@ -52,19 +52,17 @@ function! s:InitColor()
|
||||
let gui_color = g:indentLine_color_gui
|
||||
endif
|
||||
|
||||
if ! exists("g:indentLine_color_tty")
|
||||
if &background is# "light"
|
||||
let tty_color = 4
|
||||
else
|
||||
let tty_color = 2
|
||||
endif
|
||||
else
|
||||
let tty_color = g:indentLine_color_tty
|
||||
endif
|
||||
|
||||
execute "highlight Conceal ctermfg=" . term_color . " ctermbg=NONE"
|
||||
execute "highlight Conceal guifg=" . gui_color . " guibg=NONE"
|
||||
|
||||
if &term is# "linux"
|
||||
if &background is# "light"
|
||||
let tty_color = exists("g:indentLine_color_tty_light") ? g:indentLine_color_tty_light : 4
|
||||
else
|
||||
let tty_color = exists("g:indentLine_color_tty_dark") ? g:indentLine_color_tty_dark : 2
|
||||
endif
|
||||
execute "highlight Conceal cterm=bold ctermfg=" . tty_color . " ctermbg=NONE"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"{{{1 function! s:SetIndentLine()
|
||||
@@ -165,3 +163,4 @@ command! -nargs=? IndentLinesReset call <SID>ResetWidth(<f-args>)
|
||||
command! IndentLinesToggle call <SID>IndentLinesToggle()
|
||||
|
||||
" vim:et:ts=4:sw=4:fdm=marker:fmr={{{,}}}
|
||||
|
||||
|
||||
@@ -46,9 +46,15 @@ g:indentLine_color_gui *g:indentLine_color_gui*
|
||||
Specify GUI vim indent line color.
|
||||
e.g. let g:indentLine_color_gui = '#A4E57E'
|
||||
|
||||
g:indentLine_color_tty *g:indentLine_color_tty*
|
||||
Specify none X terminal vim indent line color. (0 - 7)
|
||||
e.g. let g:indentLine_color_tty = 2
|
||||
g:indentLine_color_tty_light *g:indentLine_color_tty_light*
|
||||
Specify none X terminal vim indent line color in bg light.
|
||||
default: 4
|
||||
e.g. let g:indentLine_color_tty_light = 7
|
||||
|
||||
g:indentLine_color_tty_dark *g:indentLine_color_tty_dark*
|
||||
Specify none X terminal vim indent line color in bg dark.
|
||||
default: 2
|
||||
e.g. let g:indentLine_color_tty_dark = 1
|
||||
|
||||
g:indentLine_indentLevel *g:indentLine_indentLevel*
|
||||
Specify how much indent level do you want to use for
|
||||
|
||||
Reference in New Issue
Block a user