Allow default mapping to be overridden.

This commit is contained in:
Nate Kane 2012-05-22 08:52:46 +10:00
parent cf6f4d4661
commit c909e3193a
2 changed files with 14 additions and 4 deletions

View File

@ -156,14 +156,14 @@ Default: 0. Values: 0 or 1.
The default mapping for toggling indent guides is <Leader>ig. You can easily
map it to other keys. For example:
>
:nmap <Leader>ig :IndentGuidesToggle<CR>
:nmap <silent> <Leader>ig <Plug>IndentGuidesToggle
<
You can also map some other commands that are not mapped by default. For
example:
>
:nmap <Leader>ie :IndentGuidesEnable<CR>
:nmap <Leader>id :IndentGuidesDisable<CR>
:nmap <silent> <Leader>ie <Plug>IndentGuidesEnable
:nmap <silent> <Leader>id <Plug>IndentGuidesDisable
<
==============================================================================
@ -226,6 +226,9 @@ Bug reports, feedback, suggestions etc are welcomed.
==============================================================================
7. CHANGELOG *indent-guides-changelog*
1.7 (pending release)~
* Added way to override the default mapping (thanks xuhdev).
1.6~
* Added option g:|indent_guides_space_guides| to control whether spaces are
considered as indention (thanks scoz).

View File

@ -55,7 +55,14 @@ call s:InitVariable('g:indent_guides_debug', 0 )
call s:InitVariable('g:indent_guides_space_guides', 1 )
" Default mapping
nmap <Leader>ig :IndentGuidesToggle<CR>
if !hasmapto('<Plug>IndentGuidesToggle')
nmap <silent><unique> <Leader>ig <Plug>IndentGuidesToggle
endif
" Plug mappings
nnoremap <unique><script> <Plug>IndentGuidesToggle :IndentGuidesToggle<CR>
nnoremap <unique><script> <Plug>IndentGuidesEnable :IndentGuidesEnable<CR>
nnoremap <unique><script> <Plug>IndentGuidesDisable :IndentGuidesDisable<CR>
" Auto commands
augroup indent_guides