diff --git a/README.md b/README.md index b6c9c58..3d35ace 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +NOTE +==== +This is an improve version of original plugin. +The original version plugin is at here https://github.com/Yggdroot/indentLine.git + indentLine ========== @@ -17,9 +22,10 @@ For gvim, hi Conceal guifg=(color you like) guibg=NONE For vim, hi Conceal ctermfg=(color you like) ctermbg=NONE +You can change indentline char by youself. +change this variable: + ## Screenshots - - - + diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim new file mode 100644 index 0000000..8871e2e --- /dev/null +++ b/after/plugin/indentLine.vim @@ -0,0 +1,54 @@ +" Script Name: indentLine.vim +" Version: 1.0.1 +" Last Change: Dec 3, 2012 +" Author: Yggdroot +" +" Description: To show the indent line + +if !has("conceal") || exists("g:loaded_indentLine") + finish +endif +let g:loaded_indentLine = 1 +if !exists("g:indentLine_char") + " | ┆ │ + let g:indentLine_char = "┆" +endif +if !exists("g:indentLine_color_term") + if &bg =~? "light" + let g:indentLine_color_term = 238 + else + let g:indentLine_color_term = 039 + endif +endif +if !exists("g:indentLine_color_gui") + if &bg =~? "light" + let g:indentLine_color_gui = "Grey" + else + let g:indentLine_color_gui = "Grey40" + endif +endif + +if !exists("g:indentLine_indentLevel") + let g:indentLine_indentLevel = 10 +endif + +set conceallevel=1 +set concealcursor=inc + +function! InitColor() + exec "hi Conceal ctermfg=" . g:indentLine_color_term . " ctermbg=NONE cterm=bold" . + \ " guifg=" . g:indentLine_color_gui . " guibg=NONE" +endfunction + +function! SetIndentLine() + let space = &l:shiftwidth + for i in range(space+1, space * g:indentLine_indentLevel + 1, space) + exec 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=' . g:indentLine_char + endfor +endfunction + +autocmd BufRead * call SetIndentLine() +autocmd BufRead,ColorScheme * call InitColor() + + +" vim:et:ts=4:sw=4:fdm=marker:fmr={{{,}}} diff --git a/doc/indentLine.txt b/doc/indentLine.txt new file mode 100644 index 0000000..2c8ea8f --- /dev/null +++ b/doc/indentLine.txt @@ -0,0 +1,47 @@ +*indentLine.txt* Show vertical lines for indent with conceal feature + +CONTENTS *indentLine-contents* +Introduction |indentLine-introduction| +Config |indentLine-config| +FAQ |indentLine-faq| +Changelog |indentLine-changelog| + +============================================================================== +INTRODUCTION *indentLine-introduction* + +============================================================================== +CONFIG *indentLine-config* + +------------------------------------------------------------------------------ +VARIABLES *indentLine-variables* + +g:loaded_indentLine *g:loaded_indentLine* + Whether load indentLine plugin. + Default value is 0. + +g:indentLine_char *g:indentLine_char* + Specify a character to be used as indent line. + You also can use other characters: + | ┆ │ + Default value is "┆". + +g:indentLine_color_term *g:indentLine_color_term* + Specify terminal vim indent line color. + Default value is 238. + +g:indentLine_color_gui *g:indentLine_color_gui* + Specify GUI vim indent line color. + Default value is "Grey". + +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 + 10. + Default value is 10. + + +============================================================================== +FAQ *indentLine-faq* + +============================================================================== +vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0 diff --git a/indentLine.vim b/indentLine.vim deleted file mode 100644 index 6c0248a..0000000 --- a/indentLine.vim +++ /dev/null @@ -1,31 +0,0 @@ -" Script Name: indentLine.vim -" Version: 1.0.1 -" Last Change: Dec 3, 2012 -" Author: Yggdroot -" -" Description: To show the indent line - -if !has("conceal") || exists("g:loaded_indentLine") - finish -endif -let g:loaded_indentLine = 1 - -set conceallevel=2 -set concealcursor=inc - -function! InitColor() - if &bg == 'light' - hi Conceal ctermfg=7 ctermbg=NONE guifg=Grey guibg=NONE - else - hi Conceal ctermfg=8 ctermbg=NONE guifg=Grey40 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 BufRead,ColorScheme * call InitColor()