Skip to content

Commit c8f2f3c

Browse files
committed
Add option g:indent_guides_default_mapping
1 parent a570008 commit c8f2f3c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

doc/indent_guides.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ map it to other keys. For example:
168168
:nmap <silent> <Leader>ig <Plug>IndentGuidesToggle
169169
<
170170

171+
The plugin will not provide the default mapping if either:
172+
* You already have something mapped to <Plug>IndentGuidesToggle.
173+
* You are already using the <Leader>ig key sequence.
174+
* You set to 0 the variable g:indent_guides_default_mapping:
175+
>
176+
let g:indent_guides_default_mapping=0
177+
<
178+
171179
You can also map some other commands that are not mapped by default. For
172180
example:
173181
>

plugin/indent_guides.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,15 @@ call s:InitVariable('g:indent_guides_start_level', 1 )
5353
call s:InitVariable('g:indent_guides_enable_on_vim_startup', 0 )
5454
call s:InitVariable('g:indent_guides_debug', 0 )
5555
call s:InitVariable('g:indent_guides_space_guides', 1 )
56+
call s:InitVariable('g:indent_guides_default_mapping', 1 )
5657

5758
if !exists('g:indent_guides_exclude_filetypes')
5859
let g:indent_guides_exclude_filetypes = ['help']
5960
endif
6061

6162
" Default mapping
6263
if !hasmapto('<Plug>IndentGuidesToggle', 'n') && maparg('<Leader>ig', 'n') == ''
64+
\ && g:indent_guides_default_mapping != 0
6365
nmap <silent><unique> <Leader>ig <Plug>IndentGuidesToggle
6466
endif
6567

0 commit comments

Comments
 (0)