From 0a0871232994745d004cddd9f81ff0b7498dabfa Mon Sep 17 00:00:00 2001 From: xinleibird Date: Sun, 13 Apr 2014 18:45:37 +0800 Subject: [PATCH 1/2] mount none X that 16-colors tty (my ubuntu's Ctrl+Alt+F1) --- after/plugin/indentLine.vim | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index 68ef068..8e9c3d8 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -14,8 +14,8 @@ endif let g:indentLine_loaded = 1 -let g:indentLine_char = get(g:,'indentLine_char',(&encoding is# "utf-8" ? '¦' : '|')) -let g:indentLine_first_char = get(g:,'indentLine_first_char',(&encoding is# "utf-8" ? '¦' : '|')) +let g:indentLine_char = get(g:,'indentLine_char',(&encoding is# "utf-8" && &term isnot# "linux" ? '¦' : '|')) +let g:indentLine_first_char = get(g:,'indentLine_first_char',(&encoding is# "utf-8" && &term isnot# "linux" ? '¦' : '|')) let g:indentLine_indentLevel = get(g:,'indentLine_indentLevel',10) let g:indentLine_enabled = get(g:,'indentLine_enabled',1) let g:indentLine_fileType = get(g:,'indentLine_fileType',[]) @@ -52,8 +52,19 @@ 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" endfunction "{{{1 function! s:SetIndentLine() From 51ac7b0b54de6302c90d19fd5c3a40afdc9f42cd Mon Sep 17 00:00:00 2001 From: xinleibird Date: Sun, 13 Apr 2014 18:56:27 +0800 Subject: [PATCH 2/2] update doc and readme --- README.md | 1 + doc/indentLine.txt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 9539684..25e0f1c 100644 --- a/README.md +++ b/README.md @@ -15,6 +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 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/doc/indentLine.txt b/doc/indentLine.txt index 0d29cc5..74a8cff 100644 --- a/doc/indentLine.txt +++ b/doc/indentLine.txt @@ -46,6 +46,10 @@ 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_indentLevel *g:indentLine_indentLevel* Specify how much indent level do you want to use for indentLine. Most program will not has bigger indent level than