From dd88b0b06ee69c79c27177db041ad94e604014af Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Sat, 15 Dec 2012 13:50:30 +0800 Subject: [PATCH 01/15] move plugin file to after/plugin 1. compatible with pathogen and vundle etc 2. load lastly, override other settings. --- indentLine.vim => after/plugin/indentLine.vim | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename indentLine.vim => after/plugin/indentLine.vim (100%) diff --git a/indentLine.vim b/after/plugin/indentLine.vim similarity index 100% rename from indentLine.vim rename to after/plugin/indentLine.vim From 27b20481ea547e25646aa54e8882152228782f93 Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Sat, 15 Dec 2012 13:52:57 +0800 Subject: [PATCH 02/15] change default indentlines color --- after/plugin/indentLine.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index 6c0248a..08745eb 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -15,9 +15,10 @@ set concealcursor=inc function! InitColor() if &bg == 'light' - hi Conceal ctermfg=7 ctermbg=NONE guifg=Grey guibg=NONE + " ctermfg= 039, 234 + hi Conceal ctermfg=039 ctermbg=NONE guifg=Grey guibg=NONE else - hi Conceal ctermfg=8 ctermbg=NONE guifg=Grey40 guibg=NONE + hi Conceal ctermfg=235 ctermbg=NONE guifg=Grey40 guibg=NONE endif endfunction From 5950845f9656d68a1b735fd46e63e59194437630 Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Sat, 15 Dec 2012 13:53:14 +0800 Subject: [PATCH 03/15] change default indentline --- after/plugin/indentLine.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index 08745eb..b7c66df 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -24,7 +24,8 @@ endfunction function! SetIndentLine() for i in range(&shiftwidth+1, 100, &shiftwidth) - exe 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=|' + " | ┆ │ + exe 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=┆' endfor endfunction From c03508a6788e33dc367da2473d7df9c76fccdbf3 Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Sat, 15 Dec 2012 13:53:50 +0800 Subject: [PATCH 04/15] remove trailing whitespace --- after/plugin/indentLine.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index b7c66df..acb24ef 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -7,7 +7,7 @@ if !has("conceal") || exists("g:loaded_indentLine") finish -endif +endif let g:loaded_indentLine = 1 set conceallevel=2 From 8ff780c42472bc5277079b035147aa9ec5cdf087 Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Sat, 15 Dec 2012 13:58:12 +0800 Subject: [PATCH 05/15] make indentline char configurable --- README.md | 7 +++++++ after/plugin/indentLine.vim | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b6c9c58..88f3eba 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,13 @@ 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: + +```vim +let g:indentLine_char = "│" +``` + ## Screenshots diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index acb24ef..414825e 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -9,6 +9,10 @@ if !has("conceal") || exists("g:loaded_indentLine") finish endif let g:loaded_indentLine = 1 +if !exists("g:indentLine_char") + " | ┆ │ + let g:indentLine_char = "┆" +endif set conceallevel=2 set concealcursor=inc @@ -24,8 +28,7 @@ endfunction function! SetIndentLine() for i in range(&shiftwidth+1, 100, &shiftwidth) - " | ┆ │ - exe 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=┆' + exe 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=' . g:indentLine_char endfor endfunction From bb8e9c547985ff8cb2d3090ca9dd5d010dedd0b4 Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Sat, 15 Dec 2012 14:02:28 +0800 Subject: [PATCH 06/15] no need to use conceallevel=2 --- after/plugin/indentLine.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index 414825e..44de08a 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -14,7 +14,7 @@ if !exists("g:indentLine_char") let g:indentLine_char = "┆" endif -set conceallevel=2 +set conceallevel=1 set concealcursor=inc function! InitColor() From 6cd4526bc3ea958ac84a3032153f9166c4ef0cc7 Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Tue, 18 Dec 2012 19:00:38 +0800 Subject: [PATCH 07/15] add options to specify indent lines color --- after/plugin/indentLine.vim | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index 44de08a..83fa189 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -13,17 +13,27 @@ if !exists("g:indentLine_char") " | ┆ │ let g:indentLine_char = "┆" endif +if !exists("g:indentLine_color_term") + if &bg =~? "light" + let g:indentLine_color_term = 235 + 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 set conceallevel=1 set concealcursor=inc function! InitColor() - if &bg == 'light' - " ctermfg= 039, 234 - hi Conceal ctermfg=039 ctermbg=NONE guifg=Grey guibg=NONE - else - hi Conceal ctermfg=235 ctermbg=NONE guifg=Grey40 guibg=NONE - endif + exec "hi Conceal ctermfg=" . g:indentLine_color_term . " ctermbg=NONE cterm=bold" . + \ " guifg=" . g:indentLine_color_gui . " guibg=NONE" endfunction function! SetIndentLine() From aa17434c875fac84aa79f606179dae6f360b4345 Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Thu, 20 Dec 2012 00:54:11 +0800 Subject: [PATCH 08/15] should read shiftwidth var from buffer locale --- after/plugin/indentLine.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index 83fa189..b9db1e3 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -37,7 +37,7 @@ function! InitColor() endfunction function! SetIndentLine() - for i in range(&shiftwidth+1, 100, &shiftwidth) + for i in range(&l:shiftwidth+1, 100, &shiftwidth) exe 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=' . g:indentLine_char endfor endfunction From 54b1c7f31e1b0478371def30f51183a5572c43af Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Thu, 20 Dec 2012 01:26:08 +0800 Subject: [PATCH 09/15] fix buffer local shiftwidth variable --- after/plugin/indentLine.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index b9db1e3..20c792f 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -37,7 +37,7 @@ function! InitColor() endfunction function! SetIndentLine() - for i in range(&l:shiftwidth+1, 100, &shiftwidth) + for i in range(&l:shiftwidth+1, 100, &l:shiftwidth) exe 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=' . g:indentLine_char endfor endfunction From c510395f8af59303d05fc150fc7ecbc3e715602c Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Thu, 20 Dec 2012 01:26:46 +0800 Subject: [PATCH 10/15] add option to specify indent level --- after/plugin/indentLine.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index 20c792f..af943e9 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -28,6 +28,10 @@ if !exists("g:indentLine_color_gui") endif endif +if !exists("g:indentLine_indentLevel") + let g:indentLine_indentLevel = 10 +endif + set conceallevel=1 set concealcursor=inc @@ -37,8 +41,9 @@ function! InitColor() endfunction function! SetIndentLine() - for i in range(&l:shiftwidth+1, 100, &l:shiftwidth) - exe 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=' . g:indentLine_char + 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 From 0d66975429f4de9d38559b4724debfd6df7ee5f6 Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Thu, 20 Dec 2012 01:27:05 +0800 Subject: [PATCH 11/15] change default indent line color --- after/plugin/indentLine.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index af943e9..5323385 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -15,7 +15,7 @@ if !exists("g:indentLine_char") endif if !exists("g:indentLine_color_term") if &bg =~? "light" - let g:indentLine_color_term = 235 + let g:indentLine_color_term = 238 else let g:indentLine_color_term = 039 endif From cf5979dd13e656c2e679719e11e863c7fbb53607 Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Thu, 20 Dec 2012 02:02:55 +0800 Subject: [PATCH 12/15] add plugin doc file --- README.md | 4 ---- doc/indentLine.txt | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 doc/indentLine.txt diff --git a/README.md b/README.md index 88f3eba..c3e7046 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,6 @@ For vim, hi Conceal ctermfg=(color you like) ctermbg=NONE You can change indentline char by youself. change this variable: -```vim -let g:indentLine_char = "│" -``` - ## Screenshots 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 From 68806c27963d0c4d4fafa7269d7e75585e8bf3e5 Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Thu, 20 Dec 2012 02:09:17 +0800 Subject: [PATCH 13/15] update README --- README.md | 9 ++++++--- after/plugin/indentLine.vim | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c3e7046..1942763 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 ========== @@ -21,8 +26,6 @@ You can change indentline char by youself. change this variable: ## Screenshots - - - + diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index 5323385..8871e2e 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -49,3 +49,6 @@ endfunction autocmd BufRead * call SetIndentLine() autocmd BufRead,ColorScheme * call InitColor() + + +" vim:et:ts=4:sw=4:fdm=marker:fmr={{{,}}} From 1a6a728278fa7cc50a19490e7a6df1680caca648 Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Thu, 20 Dec 2012 02:11:19 +0800 Subject: [PATCH 14/15] fix screenshot address --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1942763..c66f26b 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,6 @@ You can change indentline char by youself. change this variable: ## Screenshots - + From ea3ee8611c91a20515f9b99df8f7e59e9e7d2679 Mon Sep 17 00:00:00 2001 From: NagatoPain Date: Thu, 20 Dec 2012 02:12:43 +0800 Subject: [PATCH 15/15] change screenshot size --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c66f26b..3d35ace 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,6 @@ You can change indentline char by youself. change this variable: ## Screenshots - +