diff --git a/README.md b/README.md index 25e0f1c..c15f359 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ If you use a plugin manager you can put the whole directory into your `~/.vim/bu ## Customization 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 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_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. diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index b3214c5..f09836b 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -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" - execute "highlight Conceal cterm=bold ctermfg=" . tty_color . " ctermbg=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 ResetWidth() command! IndentLinesToggle call IndentLinesToggle() " vim:et:ts=4:sw=4:fdm=marker:fmr={{{,}}} + diff --git a/doc/indentLine.txt b/doc/indentLine.txt index 74a8cff..82db783 100644 --- a/doc/indentLine.txt +++ b/doc/indentLine.txt @@ -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