Skip to content

Commit 3c86647

Browse files
committed
Added new global option to configure whether the plugin is enabled on Vim startup
1 parent 0c21480 commit 3c86647

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

doc/indent_guides.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010

1111
Author: Nate Kane <nathanaelkane AT gmail DOT com>
12-
Version: 1.3
13-
Last Change: 17 Jan 2011
12+
Version: 1.4
13+
Last Change: 24 Jan 2011
1414

1515
==============================================================================
1616
CONTENTS *indent-guides-contents*
@@ -126,6 +126,15 @@ Default: 1. Values: between 1 and g:|indent_guides_indent_levels|.
126126
let g:indent_guides_start_level = 2
127127
<
128128

129+
------------------------------------------------------------------------------
130+
*'indent_guides_enable_on_vim_startup'*
131+
Use this option to control whether the plugin is enabled on Vim startup.
132+
133+
Default: 0. Values: 0 or 1.
134+
>
135+
let g:indent_guides_enable_on_vim_startup = 0
136+
<
137+
129138
==============================================================================
130139
4. MAPPINGS *indent-guides-mappings*
131140

@@ -203,6 +212,9 @@ Bug reports, feedback, suggestions etc are welcomed.
203212
==============================================================================
204213
7. CHANGELOG *indent-guides-changelog*
205214

215+
1.4~
216+
* Added the new plugin option g:|indent_guides_enable_on_vim_startup|.
217+
206218
1.3~
207219
* Changed the default value of g:|indent_guides_color_change_percent| to 10.
208220
* Added support for gVim themes that don't specify a `hi Normal guibg`

plugin/indent_guides.vim

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,25 @@ let g:indent_guides_color_hex_guibg_pattern = 'guibg=\zs' . g:indent_guides_col
4545
let g:indent_guides_color_name_guibg_pattern = "guibg='\\?\\zs[0-9A-Za-z ]\\+\\ze'\\?"
4646

4747
" Configurable global variables
48-
call s:InitVariable('g:indent_guides_indent_levels', 30)
49-
call s:InitVariable('g:indent_guides_auto_colors', 1 )
50-
call s:InitVariable('g:indent_guides_color_change_percent', 10) " ie. 10%
51-
call s:InitVariable('g:indent_guides_guide_size', 0 )
52-
call s:InitVariable('g:indent_guides_start_level', 1 )
53-
call s:InitVariable('g:indent_guides_debug', 0 )
48+
call s:InitVariable('g:indent_guides_indent_levels', 30)
49+
call s:InitVariable('g:indent_guides_auto_colors', 1 )
50+
call s:InitVariable('g:indent_guides_color_change_percent', 10) " ie. 10%
51+
call s:InitVariable('g:indent_guides_guide_size', 0 )
52+
call s:InitVariable('g:indent_guides_start_level', 1 )
53+
call s:InitVariable('g:indent_guides_enable_on_vim_startup', 0 )
54+
call s:InitVariable('g:indent_guides_debug', 0 )
5455

5556
" Default mapping
5657
nmap <Leader>ig :IndentGuidesToggle<CR>
5758
5859
" Auto commands
5960
augroup indent_guides
6061
autocmd!
62+
63+
if g:indent_guides_enable_on_vim_startup
64+
autocmd VimEnter * :IndentGuidesEnable
65+
endif
66+
6167
autocmd BufEnter,WinEnter * call indent_guides#process_autocmds()
6268
augroup END
6369

0 commit comments

Comments
 (0)