From 5173b63a32ed6701ede4b77a5d247d8379d3e0ab Mon Sep 17 00:00:00 2001 From: haya14busa Date: Sat, 21 Dec 2013 23:01:01 +0900 Subject: [PATCH] Update Document drastically! mapping JumpToAnywhere motion and others --- doc/easymotion.txt | 270 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 211 insertions(+), 59 deletions(-) diff --git a/doc/easymotion.txt b/doc/easymotion.txt index 3aff2fa..82ec529 100644 --- a/doc/easymotion.txt +++ b/doc/easymotion.txt @@ -1,4 +1,4 @@ -*easymotion.txt* Version 1.3. Last change: 2013 Oct 5 +*easymotion.txt* Version 2.0 Last change:21 Dec 2013. ______ __ ___ __ _ @@ -16,6 +16,8 @@ CONTENTS *easymotion-contents* 1. Introduction ....................... |easymotion-introduction| 2. Usage .............................. |easymotion-usage| 2.1 Default mappings ............... |easymotion-default-mappings| + 2.2 More mappings .................. |easymotion-more-mappings| + 2.3 Special mappings ............... |easymotion-special-mappings| 3. Requirements ....................... |easymotion-requirements| 4. Configuration ...................... |easymotion-configuration| 4.1 EasyMotion_keys ................ |EasyMotion_keys| @@ -30,7 +32,6 @@ CONTENTS *easymotion-contents* 4.10 Custom mappings ................ |easymotion-custom-mappings| 4.10.1 Leader key ............... |easymotion-leader-key| 4.10.2 Custom keys .............. |easymotion-custom-keys| - 4.10.3 Special Custom keys ...... |easymotion-special-custom-keys| 4.11 Easymotion special functions ... |easymotion-special-mappings| 4.11.1 Select Line .............. |easymotion-select-line| 4.11.2 Select Phrase ............ |easymotion-select-phrase| @@ -85,9 +86,12 @@ And that's it! 2.1 Default mappings *easymotion-default-mappings* The default configuration defines the following mappings in normal, -visual and operator-pending mode: +visual and operator-pending mode if |g:EasyMotion_do_mapping| is on: - Mapping | Details +Note: The default leader has been changed to to avoid + conflicts with other plugins you may have installed + + Default Mapping | Details ---------------------|---------------------------------------------- f{char} | Find {char} to the right. See |f|. F{char} | Find {char} to the left. See |F|. @@ -105,17 +109,127 @@ visual and operator-pending mode: k | Line upward. See |k|. n | Jump to latest "/" or "?" forward. See |n|. N | Jump to latest "/" or "?" backward. See |N|. - s | Find(Search) {char} forward and backward. See |f| and |F|. - S | Beginning of word forward and backward. See |w| and |b|. - | - Special Mapping | Details - ---------------------|---------------------------------------------- - {operator}l | Select, yank, paste, delete, or other operation of lines. See |easymotion-special-function|. - {operator}p | Select, yank, paste, delete, or other operation of phrase. See |easymotion-special-function|. + s | Find(Search) {char} forward and backward. + | See |f| and |F|. + S | Beginning of word forward and backward. + | See |w| and |b|. See |easymotion-leader-key| and |mapleader| for details about the leader key. See |easymotion-custom-mappings| for customizing the default mappings. +EasyMotion table *easymotion-plug-table* + + Mapping Table | Default + ---------------------|---------------------------------------------- + (easymotion-f) | f{char} + (easymotion-F) | F{char} + (easymotion-t) | t{char} + (easymotion-T) | T{char} + (easymotion-w) | w + (easymotion-W) | W + (easymotion-b) | b + (easymotion-B) | B + (easymotion-e) | e + (easymotion-E) | E + (easymotion-ge)| ge + (easymotion-gE)| gE + (easymotion-j) | j + (easymotion-k) | k + (easymotion-n) | n + (easymotion-N) | N + (easymotion-s) | s + (easymotion-S) | S + + More Mapping Table | (No assignment by default) + ----------------------------------|--------------------------------- + (easymotion-bd-w) | See |(easymotion-bd-w)| + (easymotion-bd-W) | See |(easymotion-bd-W)| + (easymotion-bd-e) | See |(easymotion-bd-e)| + (easymotion-bd-E) | See |(easymotion-bd-E)| + (easymotion-bd-jk) | See |(easymotion-bd-jk)| + (easymotion-bd-n) | See |(easymotion-bd-n)| + (easymotion-jumptoanywhere) | See |(easymotion-jumptoanywhere)| + Special | + ----------------------------------|--------------------------------- + (easymotion-special-l) | See |(easymotion-special-l)| + (easymotion-special-p) | See |(easymotion-special-p)| + + +------------------------------------------------------------------------------ +2.2 More mappings *easymotion-more-mappings* + +These mappings are not mapped by Default. + +(easymotion-bd-w) *(easymotion-bd-w)* + Beginning of word forward and backward. See |w| & |b|. + Note: bd is short for bidirectional + +(easymotion-bd-W) *(easymotion-bd-W)* + Beginning of WORD forward and backward. See |W| & |B|. + +(easymotion-bd-e) *(easymotion-bd-e)* + End of word forward and backward. See |e| & |ge|. + +(easymotion-bd-E) *(easymotion-bd-E)* + End of WORD forward and backward. See |e| & |ge|. + +(easymotion-bd-jk) *(easymotion-bd-jk)* + Line downward and upward. See |j| & |k|. + +(easymotion-bd-n) *(easymotion-bd-n)* + Jump to latest "/" or "?" forward. See |n| & |N|. + +(easymotion-jumptoanywhere) *(easymotion-jumptoanywhere)* + JumpToAnywhere motion! + Default: Beginning and End of word, Camelcase, after '_', + and after '#'. + You can modify this motion behavior by vimrc + + |g:EasyMotion_re_anywhere|: *g:EasyMotion_re_anywhere* +> + let g:EasyMotion_re_anywhere = '\v' . + \ '(<.|^$)' . '|' . + \ '(.>|^$)' . '|' . + \ '(\l)\zs(\u)' . '|' . + \ '(_\zs.)' . '|' . + \ '(#\zs.)' +< + Modified example: +> + let g:EasyMotion_re_anywhere = '\v' . + \ '(<.|^)' . '|' . + \ '(<.|.$)' . '|' . + \ '(\l)\zs(\u)' . '|' . +< + +------------------------------------------------------------------------------ +2.3 Special mappings *easymotion-special-mappings* + +The default configuration defines the following mappings in visual and +operator-pending mode if |g:EasyMotion_do_special_mapping| is on: +> + let g:EasyMotion_do_special_mapping = 1 +< +Default: 0 + + Special Mapping | Details + ---------------------|---------------------------------------------- + {operator}l | Select, yank, paste, delete, or other operation of + | lines. See |(easymotion-special-l)|. + {operator}p | Select, yank, paste, delete, or other operation of + | phrase. See |(easymotion-special-p)|. + +or you can map them by yourself + + Mapping Table | Details + -----------------------------|-------------------------------------- + (easymotion-special-l) | See |(easymotion-special-l)| + (easymotion-special-p) | See |(easymotion-special-p)| + + +See |easymotion-leader-key| and |mapleader| for details about the leader key. +TODO: improvement + ============================================================================== 3. Requirements *easymotion-requirements* @@ -124,6 +238,11 @@ any problems in vim 7.2. Vi-compatible mode must be disabled. +Note: Now @haya14busa maintain EasyMotion in vim 7.4. If there is any +problems, open an issue or pull requests are welcome. + +https://github.com/haya14busa/vim-easymotion/issues + ============================================================================== 4. Configuration *easymotion-configuration* @@ -138,6 +257,7 @@ Example (this will change the target keys and disable shading): > ------------------------------------------------------------------------------ 4.1 EasyMotion_keys *EasyMotion_keys* + *g:EasyMotion_keys* Set the keys which will be used for motion targets. Add as many keys as you want. There's a lower chance that the motion targets will be grouped if many @@ -147,6 +267,7 @@ Default: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ------------------------------------------------------------------------------ 4.2 EasyMotion_do_shade *EasyMotion_do_shade* + *g:EasyMotion_do_shade* The default behavior is to shade the text following the cursor (forward motions) or preceding the cursor (backward motions) to make the motion targets @@ -156,18 +277,19 @@ Default: 1 ------------------------------------------------------------------------------ 4.3 EasyMotion_do_mapping *EasyMotion_do_mapping* + *g:EasyMotion_do_mapping* Set this option to 0 if you want to disable the default mappings. See |easymotion-default-mappings| for details about the default mappings. -Note: If you disable this option, you'll have to map the motions yourself. See -the plugin source code for mapping details. You usually shouldn't need to do -this, see |easymotion-custom-mappings| for customizing the default mappings. +Note: If you disable this option, you'll have to map the motions yourself. + See |easymotion-custom-mappings| for customizing the default mappings. Default: 1 ------------------------------------------------------------------------------ 4.4 EasyMotion_grouping *EasyMotion_grouping* + *g:EasyMotion_grouping* When there are too many possible targets on the screen, the results have to be grouped. This configuration option lets you change which grouping algorithm @@ -212,6 +334,7 @@ Default: 1 ------------------------------------------------------------------------------ 4.5 Start of Line *EasyMotion_startofline* + *g:EasyMotion_startofline* When using the |j| or |k| motion, the cursor can be configured to stay in the current column (by setting this option to 0) or to move along the first column @@ -222,7 +345,8 @@ current column (by setting this option to 0) or to move along the first column Default: 1 ------------------------------------------------------------------------------ -4.6 Smartcase *EasyMotion_smartcase* +4.6 Smartcase *EasyMotion_smartcase* + *g:EasyMotion_smartcase* Matching target keys by smartcase. You can type target keys more lazily. @@ -231,8 +355,10 @@ Add following description in your vimrc: > let g:EasyMotion_smartcase = 1 Default:0 + ------------------------------------------------------------------------------ -4.7 Migemo *EasyMotion_use_migemo* +4.7 Migemo *EasyMotion_use_migemo* + *g:EasyMotion_use_migemo* |Easymotion| can match multibyte Japanese character with a alphabet input. For example, 'fa' can search 'あ'. @@ -254,8 +380,9 @@ https://github.com/rhysd/clever-f.vim ------------------------------------------------------------------------------ 4.8 Show target key by upper letter *EasyMotion_use_upper* + *g:EasyMotion_use_upper* -|Easymotion| show target label by uppercase letter, but you can type it as +|Easymotion| shows target labels by uppercase letter, but you can type it as lowercase and Easymotion automatically convert it uppercase. This feature improve targets readability. @@ -279,7 +406,7 @@ Add following description in your vimrc: > Default:0 -Note: Make sure g:EasyMotion_keys doesn't include lowercase +Note: Make sure |g:EasyMotion_keys| doesn't include lowercase This feature is inspired by t9md's vim-smalls, which can be downloaded here: @@ -336,6 +463,7 @@ There are two ways to override the default colors: hi link EasyMotionTarget2First MatchParen hi link EasyMotionTarget2Second MatchParen < + ------------------------------------------------------------------------------ 4.10 Custom mappings *easymotion-custom-mappings* @@ -345,6 +473,7 @@ of all mappings to another key or sequence. It is also possible to fine tune the plugin to your need by changing every single sequence. 4.10.1 Leader key *EasyMotion_leader_key* *easymotion-leader-key* + *g:EasyMotion_leader_key* The default leader key can be changed with the configuration option |EasyMotion_leader_key|. @@ -362,48 +491,25 @@ Default: '' 4.10.2 Custom Keys *easymotion-custom-keys* -All custom mappings follow the same variable format: > +All custom mappings follow the same format: > - EasyMotion_mapping_{motion} = {mapping} + (easymotion-{motion}) < Example: > - let g:EasyMotion_mapping_f = '_f' - let g:EasyMotion_mapping_T = '' + map _f (easymotion-f) + map (easymotion-T) < -See |easymotion-default-mappings| for a table of motions that can be mapped +See |easymotion-plug-table| for a table of motions that can be mapped and their default values. -Note: The leader key defined by |EasyMotion_leader_key| is not prepended to -your customized mappings! You have to provide full key sequences when setting -these options. - -4.10.3 Custom Keys for Special Function *easymotion-special-custom-keys* - -All special custom mappings follow the same variable format: > - - EasyMotion_special_mapping_{motion} = {mapping} -< -Example: > - - let g:EasyMotion_special_mapping_l = 'L' - let g:EasyMotion_special_mapping_p = 'p' -< -See |easymotion-default-mappings| for a table of motions that can be mapped -and their default values. - -Note: The leader key defined by |EasyMotion_leader_key| is not prepended to -your customized mappings! You have to provide full key sequences when setting -these options. - ------------------------------------------------------------------------------ -4.11 Easymotion special functions *easymotion-special-function* +4.11 Easymotion special functions *easymotion-special-function* -4.11.1 Select Line *easymotion-select-line* +4.11.1 Select Line *easymotion-select-line* + *(easymotion-special-l)* -Default: Disabled - -SelectLines function which allows you to select any range of lines using two +SelectLine function which allows you to select any range of lines using two consecutive easymotion calls. Default mappings are `cl, dl, vl, yl`. @@ -413,17 +519,29 @@ To yank a single line you can either type the same character(s) twice, or use E.g. `vlb.` will select the line with character 'b'. -Note: to promote good Vim habits, you should learn standard movement commands like `}}, vi(, va(, %, ][, ]], [(, etc.` before resorting to this function. +Note: to promote good Vim habits, you should learn standard movement commands +like `}}, vi(, va(, %, ][, ]], [(, etc.` before resorting to this function. -Set this option to 1 if you want to enable this functions. +Set this option to 1 if you want to automatically map this function -Example: > - - let g:EasyMotion_special_select_line = 1 +Example: +> + let g:EasyMotion_do_special_mapping = 1 Default: 0 +or map it by yourself(Recommend) +> + omap L (easymotion-special-l) + xmap L (easymotion-special-l) + nmap dL d(easymotion-special-l) + nmap yL y(easymotion-special-l) +< +Note: special line function when d & y is a little bit different. So you +should map them individually, don't define omap only. + 4.11.2 Select Phrase *easymotion-select-phrase* + *(easymotion-special-p)* (Experimental) SelectPhrase function which allows you to make selection between any two characters. @@ -440,6 +558,24 @@ Example: > Default: 0 +Set this option to 1 if you want to automatically map this function + +Example: > + + let g:EasyMotion_do_special_mapping = 1 + +Default: 0 + +or map it by yourself(Recommend) +> + omap P (easymotion-special-p) + xmap P (easymotion-special-p) + nmap dP d(easymotion-special-p) + nmap yP y(easymotion-special-p) +< +Note: special phrase function when d & y is a little bit different. So you +should map them individually, don't define omap only. + ============================================================================== 5. License *easymotion-license* @@ -450,7 +586,12 @@ http://creativecommons.org/licenses/by-sa/3.0/ ============================================================================== 6. Known bugs *easymotion-known-bugs* -None. +See: https://github.com/haya14busa/vim-easymotion/issues + and + https://github.com/Lokaltog/vim-easymotion/issues + (@haya14busa and others fix some bugs in this issues) + +Pull Requests are welcome! :) ============================================================================== 7. Contributing *easymotion-contributing* @@ -462,6 +603,12 @@ have any code improvements. Author: Kim Silkebækken Source repository: https://github.com/Lokaltog/vim-easymotion + +Forked and modified by haya14busa, currently maintain EasyMotion + +Author: haya14busa +Source repository: https://github.com/haya14busa/vim-easymotion + ============================================================================== 8. Credits *easymotion-credits* @@ -479,24 +626,29 @@ can be downloaded here: http://www.vim.org/scripts/script.php?script_id=3437 ------------------------------------------------------------------------------ -Forked and modified by haya14busa +Forked and modified by haya14busa~ Author: haya14busa Source repository: https://github.com/haya14busa/vim-easymotion -Ref: +Ref:~ - supasorn : two key combos and special function - mtth : startofline(keep column) - bootleq : fixed bufname bug - mattn : fix multibyte handling - yuex : fix visual mode selection bug (o command) -Migemo: +Migemo feature:~ Easymotion migemo function is based on rhysd(@Linda_pp)'s clever-f script, which can be downloaded here: https://github.com/rhysd/clever-f.vim +Show uppercase letter and type it as lowercase:~ +This feature is inspired by t9md's vim-smalls, which can be downloaded here: + +https://github.com/t9md/vim-smalls + ============================================================================== vim:tw=78:sw=4:ts=8:ft=help:norl: