Merge branch 'feature/configurable-leader' into develop

* feature/configurable-leader:
  Add credits
  Update doc section numbers
  Documentation for leader key option
  Configurable Leader key
This commit is contained in:
Kim Silkebækken 2011-04-02 17:18:54 +02:00
commit d1fdc42da6
2 changed files with 21 additions and 3 deletions

View File

@ -215,7 +215,20 @@ Default: 1
4.7 Custom mappings *easymotion-custom-mappings* 4.7 Custom mappings *easymotion-custom-mappings*
EasyMotion allows you to customize all default mappings to avoid conflicts EasyMotion allows you to customize all default mappings to avoid conflicts
with existing mappings. All custom mappings follow the same variable format: > with existing mappings. First, it is possible to change the default <leader>
key of all mappings to another key or sequence. It is also possible to fine
tune this plugin to your need by changing every single sequence.
4.7.1 EasyMotion_leader_key *easymotion-leader-key*
Set this option to the key sequence to use as the prefix of the mappings
described in |easymotion-default-mappings|.
Default: '<Leader>'
4.7.2 Custom Keys
All custom mappings follow the same variable format: >
EasyMotion_mapping_{motion} = {mapping} EasyMotion_mapping_{motion} = {mapping}
@ -227,6 +240,9 @@ Example: >
See |easymotion-default-mappings| for a table of motions that can be mapped See |easymotion-default-mappings| for a table of motions that can be mapped
and their default values. and their default values.
Note: The leader key defined by EasyMotion_leader_key is not prepended to your
customized mappings. You have to give full key sequences.
============================================================================== ==============================================================================
5. License *easymotion-license* 5. License *easymotion-license*
@ -255,6 +271,7 @@ Source repository: https://github.com/Lokaltog/vim-easymotion
- Ben Boeckel: ge motion - Ben Boeckel: ge motion
- Drew Neil: operator-pending mappings - Drew Neil: operator-pending mappings
- Rob O'Dwyer: customizable mappings without giving up all defaults - Rob O'Dwyer: customizable mappings without giving up all defaults
- Michel D'Hooge: customizable leader
EasyMotion is based on Bartlomiej Podolak's great PreciseJump script, which EasyMotion is based on Bartlomiej Podolak's great PreciseJump script, which
can be downloaded here: can be downloaded here:

View File

@ -28,7 +28,7 @@
endfunction " }}} endfunction " }}}
function! s:InitMappings(motions) "{{{ function! s:InitMappings(motions) "{{{
for motion in keys(a:motions) for motion in keys(a:motions)
call s:InitOptions({ 'mapping_' . motion : '<Leader>' . motion }) call s:InitOptions({ 'mapping_' . motion : g:EasyMotion_leader_key . motion })
endfor endfor
if g:EasyMotion_do_mapping if g:EasyMotion_do_mapping
@ -41,7 +41,8 @@
endfunction "}}} endfunction "}}}
" Default options {{{ " Default options {{{
call s:InitOptions({ call s:InitOptions({
\ 'keys' : 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' \ 'leader_key' : '<Leader>'
\ , 'keys' : 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
\ , 'target_hl' : 'EasyMotionTarget' \ , 'target_hl' : 'EasyMotionTarget'
\ , 'shade_hl' : 'EasyMotionShade' \ , 'shade_hl' : 'EasyMotionShade'
\ , 'do_shade' : 1 \ , 'do_shade' : 1