Skip to content

Commit 3cfeff1

Browse files
committed
Merge branch 'option-no-mapping' of git://github.com/suy/vim-indent-guides into suy-option-no-mapping
* 'option-no-mapping' of git://github.com/suy/vim-indent-guides: Add option g:indent_guides_default_mapping Conflicts: plugin/indent_guides.vim
2 parents 48a4a8f + c8f2f3c commit 3cfeff1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

doc/indent_guides.txt

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

182+
The plugin will not provide the default mapping if either:
183+
* You already have something mapped to <Plug>IndentGuidesToggle.
184+
* You are already using the <Leader>ig key sequence.
185+
* You set to 0 the variable g:indent_guides_default_mapping:
186+
>
187+
let g:indent_guides_default_mapping=0
188+
<
189+
182190
You can also map some other commands that are not mapped by default. For
183191
example:
184192
>

plugin/indent_guides.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,15 @@ 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)
5656
call s:InitVariable('g:indent_guides_soft_pattern', '\s')
57-
57+
call s:InitVariable('g:indent_guides_default_mapping', 1)
5858

5959
if !exists('g:indent_guides_exclude_filetypes')
6060
let g:indent_guides_exclude_filetypes = ['help']
6161
endif
6262

6363
" Default mapping
6464
if !hasmapto('<Plug>IndentGuidesToggle', 'n') && maparg('<Leader>ig', 'n') == ''
65+
\ && g:indent_guides_default_mapping != 0
6566
nmap <silent><unique> <Leader>ig <Plug>IndentGuidesToggle
6667
endif
6768

0 commit comments

Comments
 (0)