Add option g:indent_guides_default_mapping

This commit is contained in:
Alejandro Exojo 2013-06-26 08:28:01 +02:00
parent a5700082c7
commit c8f2f3c089
2 changed files with 10 additions and 0 deletions

View File

@ -168,6 +168,14 @@ map it to other keys. For example:
:nmap <silent> <Leader>ig <Plug>IndentGuidesToggle :nmap <silent> <Leader>ig <Plug>IndentGuidesToggle
< <
The plugin will not provide the default mapping if either:
* You already have something mapped to <Plug>IndentGuidesToggle.
* You are already using the <Leader>ig key sequence.
* You set to 0 the variable g:indent_guides_default_mapping:
>
let g:indent_guides_default_mapping=0
<
You can also map some other commands that are not mapped by default. For You can also map some other commands that are not mapped by default. For
example: example:
> >

View File

@ -53,6 +53,7 @@ call s:InitVariable('g:indent_guides_start_level', 1 )
call s:InitVariable('g:indent_guides_enable_on_vim_startup', 0 ) call s:InitVariable('g:indent_guides_enable_on_vim_startup', 0 )
call s:InitVariable('g:indent_guides_debug', 0 ) call s:InitVariable('g:indent_guides_debug', 0 )
call s:InitVariable('g:indent_guides_space_guides', 1 ) call s:InitVariable('g:indent_guides_space_guides', 1 )
call s:InitVariable('g:indent_guides_default_mapping', 1 )
if !exists('g:indent_guides_exclude_filetypes') if !exists('g:indent_guides_exclude_filetypes')
let g:indent_guides_exclude_filetypes = ['help'] let g:indent_guides_exclude_filetypes = ['help']
@ -60,6 +61,7 @@ endif
" Default mapping " Default mapping
if !hasmapto('<Plug>IndentGuidesToggle', 'n') && maparg('<Leader>ig', 'n') == '' if !hasmapto('<Plug>IndentGuidesToggle', 'n') && maparg('<Leader>ig', 'n') == ''
\ && g:indent_guides_default_mapping != 0
nmap <silent><unique> <Leader>ig <Plug>IndentGuidesToggle nmap <silent><unique> <Leader>ig <Plug>IndentGuidesToggle
endif endif