Update docs

This commit is contained in:
Kim Silkebækken 2011-06-01 10:14:20 +02:00
parent 26c84b7474
commit b8370708ea
2 changed files with 49 additions and 39 deletions

View File

@ -1,37 +1,31 @@
# Introduction # Introduction
EasyMotion provides a much simpler way to use some motions in vim. It EasyMotion provides a much simpler way to use some motions in vim. It
takes the `<number>` out of `<number>w` or `<number>f{char}` by takes the `<number>` out of `<number>w` or `<number>f{char}` by
highlighting all possible choices and allowing you to press one key to highlighting all possible choices and allowing you to press one key to
jump directly to the target. jump directly to the target.
When one of the available motions is triggered, all visible text When one of the available motions is triggered, all visible text
preceding or following the cursor is faded, and motion targets are preceding or following the cursor is faded, and motion targets are
highlighted. highlighted.
EasyMotion is triggered by one of the provided mappings. EasyMotion is triggered by one of the provided mappings.
# Important notes about the default bindings # Important notes about the default bindings
The default bindings may conflict with other plugins you have installed, The default leader has been changed to `<Leader>e` to avoid conflicts
e.g. Command-T. Please read the docs about the default bindings, it's with other plugins you may have installed. This can easily be changed
easy to rebind the EasyMotion keys or rebind the leader key in order to back by rebinding the leader in your vimrc:
"namespace" the plugin.
You can rebind the leader key in your vimrc: let g:EasyMotion_leader_key = '<Leader>'
let g:EasyMotion_leader_key = '<Leader>m' All motions are now triggered with `<Leader>e` by default, e.g.
`<Leader>et`, `<Leader>egE`.
All the motions will now be triggered with `<Leader>m` first, e.g.
`<Leader>mt`, `<Leader>mgE`. You can also remap single motions:
let g:EasyMotion_mapping_t = '_t'
let g:EasyMotion_mapping_gE = '_gE'
## Usage example ## Usage example
Type `<Leader>w` to trigger the word motion `w`. When the motion is Type `<Leader>ew` to trigger the word motion `w`. When the motion is
triggered, the text is updated (no braces are actually added, the text triggered, the text is updated (no braces are actually added, the text
is highlighted in red by default): is highlighted in red by default):
<cursor>Lorem {a}psum {b}olor {c}it {d}met. <cursor>Lorem {a}psum {b}olor {c}it {d}met.
@ -40,8 +34,8 @@ Press `c` to jump to the beginning of the word "sit":
Lorem ipsum dolor <cursor>sit amet. Lorem ipsum dolor <cursor>sit amet.
Similarly, if you're looking for an "o", you can use the `f` motion. Similarly, if you're looking for an "o", you can use the `f` motion.
Type `<Leader>fo`, and all "o" characters are highlighted: Type `<Leader>efo`, and all "o" characters are highlighted:
<cursor>L{a}rem ipsum d{b}l{c}r sit amet. <cursor>L{a}rem ipsum d{b}l{c}r sit amet.
@ -49,8 +43,8 @@ Press `b` to jump to the second "o":
Lorem ipsum d<cursor>olor sit amet. Lorem ipsum d<cursor>olor sit amet.
Jeffrey Way of Nettuts+ has also [written Jeffrey Way of Nettuts+ has also [written
a tutorial](http://net.tutsplus.com/tutorials/other/vim-essential-plugin-easymotion/) a tutorial](http://net.tutsplus.com/tutorials/other/vim-essential-plugin-easymotion/)
about EasyMotion. about EasyMotion.
## Animated demonstration ## Animated demonstration

View File

@ -24,6 +24,8 @@ CONTENTS *easymotion-contents*
4.4 EasyMotion_grouping ............ |EasyMotion_grouping| 4.4 EasyMotion_grouping ............ |EasyMotion_grouping|
4.5 Custom highlighting ............ |easymotion-custom-hl| 4.5 Custom highlighting ............ |easymotion-custom-hl|
4.6 Custom mappings ................ |easymotion-custom-mappings| 4.6 Custom mappings ................ |easymotion-custom-mappings|
4.6.1 Leader key ............... |easymotion-leader-key|
4.6.2 Custom keys .............. |easymotion-custom-keys|
5. License ............................ |easymotion-license| 5. License ............................ |easymotion-license|
6. Known bugs ......................... |easymotion-known-bugs| 6. Known bugs ......................... |easymotion-known-bugs|
7. Contributing ....................... |easymotion-contributing| 7. Contributing ....................... |easymotion-contributing|
@ -49,9 +51,10 @@ Example: >
<cursor>Lorem ipsum dolor sit amet. <cursor>Lorem ipsum dolor sit amet.
Type <Leader>w to trigger the word motion |w|. See |mapleader| for details Type <Leader>ew to trigger the word motion |w|. See
about the leader key. When the motion is triggered, the text is updated (no |easymotion-leader-key| for details about the leader key. When the
braces are actually added, the text is highlighted in red by default): > motion is triggered, the text is updated (no braces are actually added,
the text is highlighted in red by default): >
<cursor>Lorem {a}psum {b}olor {c}it {d}met. <cursor>Lorem {a}psum {b}olor {c}it {d}met.
@ -60,7 +63,7 @@ Press "c" to jump to the beginning of the word "sit": >
Lorem ipsum dolor <cursor>sit amet. Lorem ipsum dolor <cursor>sit amet.
Similarly, if you're looking for an "o", you can use the |f| motion. Similarly, if you're looking for an "o", you can use the |f| motion.
Type <Leader>fo, and all "o" characters are highlighted: > Type <Leader>efo, and all "o" characters are highlighted: >
<cursor>L{a}rem ipsum d{b}l{c}r sit amet. <cursor>L{a}rem ipsum d{b}l{c}r sit amet.
@ -92,9 +95,11 @@ visual and operator-pending mode:
<Leader>gE | End of WORD backward. See |gE|. <Leader>gE | End of WORD backward. See |gE|.
<Leader>j | Line downward. See |j|. <Leader>j | Line downward. See |j|.
<Leader>k | Line upward. See |k|. <Leader>k | Line upward. See |k|.
<Leader>n | Jump to latest "/" or "?" forward. See |n|.
<Leader>N | Jump to latest "/" or "?" backward. See |N|.
See |mapleader| for details about the leader key. See |easymotion-leader-key| and |mapleader| for details about the leader key.
See |easymotion-custom-mappings| for customizing default mappings. See |easymotion-custom-mappings| for customizing the default mappings.
============================================================================== ==============================================================================
3. Requirements *easymotion-requirements* 3. Requirements *easymotion-requirements*
@ -234,33 +239,43 @@ There are two ways to override the default colors:
4.6 Custom mappings *easymotion-custom-mappings* 4.6 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. First, it is possible to change the default <leader> with existing mappings. It is possible to change the default leader key
key of all mappings to another key or sequence. It is also possible to fine 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. tune the plugin to your need by changing every single sequence.
4.6.1 EasyMotion_leader_key *easymotion-leader-key* 4.6.1 Leader key *EasyMotion_leader_key* *easymotion-leader-key*
The default leader key can be changed with the configuration option
|EasyMotion_leader_key|.
Set this option to the key sequence to use as the prefix of the mappings Set this option to the key sequence to use as the prefix of the mappings
described in |easymotion-default-mappings|. described in |easymotion-default-mappings|.
Default: '<Leader>' Note: The default leader key has been changed to '<Leader>e' to avoid
conflicts with other plugins. You can revert to the original leader by setting
this option in your vimrc: >
4.6.2 Custom Keys let g:EasyMotion_leader_key = '<Leader>'
<
Default: '<Leader>e'
4.6.2 Custom Keys *easymotion-custom-keys*
All custom mappings follow the same variable format: > All custom mappings follow the same variable format: >
EasyMotion_mapping_{motion} = {mapping} EasyMotion_mapping_{motion} = {mapping}
<
Example: > Example: >
let g:EasyMotion_mapping_f = '_f' let g:EasyMotion_mapping_f = '_f'
let g:EasyMotion_mapping_T = '<C-T>' let g:EasyMotion_mapping_T = '<C-T>'
<
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 Note: The leader key defined by |EasyMotion_leader_key| is not prepended to
customized mappings. You have to give full key sequences. your customized mappings! You have to provide full key sequences when setting
these options.
============================================================================== ==============================================================================
5. License *easymotion-license* 5. License *easymotion-license*
@ -291,6 +306,7 @@ Source repository: https://github.com/Lokaltog/vim-easymotion
- 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 - Michel D'Hooge: customizable leader
- Maxime Bourget: search motion, improved JK motion behavior
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: