Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow default mapping to be overridden.

  • Loading branch information...
commit c909e3193ac23dc55f6f2af5761e030f9e1dbac2 1 parent cf6f4d4
Nate Kane authored
Showing with 14 additions and 4 deletions.
  1. +6 −3 doc/indent_guides.txt
  2. +8 −1 plugin/indent_guides.vim
9 doc/indent_guides.txt
View
@@ -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).
9 plugin/indent_guides.vim
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.