Improve README
This commit is contained in:
parent
5173b63a32
commit
aa0fac362f
116
README.md
116
README.md
@ -1,32 +1,14 @@
|
|||||||
# Modifications to Lokaltog's EasyMotion
|
# Vim motion on speed!
|
||||||
1. Use one - two character key jump. Display two keys if one-character key is not enough, so you can see what two keys to type without waiting after pressing the first key.
|
|
||||||
2. Added forward-backward search (bidirectional) search. You can jump forward or backward at the same time. `<Leader>s`. One useful trick is to map `nmap <SPACE> <leader>s` and `vmap <SPACE> <leader>s` to use space bar instead and save one keystroke!
|
|
||||||
3. Added SelectLines function which allows you to select any range of lines using two consecutive easymotion calls. Default mappings are `c<Leader>l, d<Leader>l, v<Leader>l, y<Leader>l`. To yank a single line you can either type the same character(s) twice, or use '.' character. 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.
|
|
||||||
4. (Experimental) Added SelectPhrase function which allows you to make selection between any two characters. Default mapping are `c<Leader>p, d<Leader>p, v<Leader>p, y<Leader>p`. Example usage: type `v<Leader>p` then press two input characters. Now the two input characters will be highlight on the same screen, and you can then type two combos to make selection.
|
|
||||||
5. Added matching target keys by smartcase option.
|
|
||||||
6. Added keep cursor column option when JK motion.
|
|
||||||
|
|
||||||
## Animated demonstration
|
|
||||||
|
|
||||||
Two-key combo
|
|
||||||
|
|
||||||
![two-character key](http://homes.cs.washington.edu/~supasorn/easymotion.gif)
|
![two-character key](http://homes.cs.washington.edu/~supasorn/easymotion.gif)
|
||||||
|
|
||||||
Select lines using `v<Leader>l`
|
Original: [Lokaltog/vim-easymotion](https://github.com/Lokaltog/vim-easymotion)
|
||||||
|
|
||||||
let g:EasyMotion_special_select_line = 1 " Default:0
|
I forked Lokaltog's vim-easymotion and currently maintain it. Fix some bugs,
|
||||||
let g:EasyMotion_special_mapping_l = '{anykeys}' " Customize keymap
|
add new features (based on supasorn's work and others), and improve some function.
|
||||||
|
|
||||||
![two-character key](http://homes.cs.washington.edu/~supasorn/easymotion2.gif)
|
I greatly appreciate Lokaltog's and others' works!
|
||||||
|
|
||||||
Yank lines using `y<Leader>l`. You can copy lines without moving cursor back and forth between line you want to yank and line you want to paste.
|
|
||||||
|
|
||||||
let g:EasyMotion_special_select_phrase = 1 " Default:0
|
|
||||||
let g:EasyMotion_special_mapping_p = '{anykeys}' " Customize keymap
|
|
||||||
|
|
||||||
![two-character key](http://homes.cs.washington.edu/~supasorn/easymotion3.gif)
|
|
||||||
|
|
||||||
This is an alpha version, which breaks multi-byte support, and others.
|
|
||||||
# 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
|
||||||
@ -51,7 +33,7 @@ changed back to pre-1.3 behavior by rebinding the leader in your vimrc:
|
|||||||
All motions are now triggered with `<Leader><Leader>` by default, e.g.
|
All motions are now triggered with `<Leader><Leader>` by default, e.g.
|
||||||
`<Leader><Leader>t`, `<Leader><Leader>gE`.
|
`<Leader><Leader>t`, `<Leader><Leader>gE`.
|
||||||
|
|
||||||
## Usage example
|
# Usage example
|
||||||
|
|
||||||
Type `<Leader><Leader>w` to trigger the word motion `w`. When the motion is
|
Type `<Leader><Leader>w` 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
|
||||||
@ -74,13 +56,24 @@ Press `b` to jump to the second "o":
|
|||||||
|
|
||||||
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 (Lokaltog's) EasyMotion.
|
||||||
|
|
||||||
## Animated demonstration
|
# Animated demonstration
|
||||||
|
|
||||||
![Animated demonstration](http://oi54.tinypic.com/2yysefm.jpg)
|
![Animated demonstration](http://oi54.tinypic.com/2yysefm.jpg)
|
||||||
|
|
||||||
## Vim-Lazymotion!
|
# New feature
|
||||||
|
Modifications to Lokaltog's EasyMotion
|
||||||
|
|
||||||
|
## Two key combo
|
||||||
|
1. Use one - two character key jump. Display two keys if one-character key is not enough, so you can see what two keys to type without waiting after pressing the first key.
|
||||||
|
|
||||||
|
![two-character key](http://homes.cs.washington.edu/~supasorn/easymotion.gif)
|
||||||
|
|
||||||
|
## Bidirectional search
|
||||||
|
Added forward-backward search (bidirectional) search. You can jump forward or backward at the same time by `<Leader>s`. One useful trick is to map `map <SPACE> <Plug>(easymotion-s)` to use space bar instead and save one keystroke!
|
||||||
|
|
||||||
|
## Find target by smartcase!
|
||||||
|
|
||||||
Matching target keys by smartcase. You can type targets more lazily.
|
Matching target keys by smartcase. You can type targets more lazily.
|
||||||
|
|
||||||
@ -100,10 +93,77 @@ Press `b` to jump to the second "V":
|
|||||||
|
|
||||||
Vim vim <cursor>VIM.
|
Vim vim <cursor>VIM.
|
||||||
|
|
||||||
|
|
||||||
Add following description in your vimrc:
|
Add following description in your vimrc:
|
||||||
|
|
||||||
let g:EasyMotion_smartcase = 1
|
let g:EasyMotion_smartcase = 1
|
||||||
|
|
||||||
Default:0
|
Default:0
|
||||||
|
|
||||||
|
## Migemo feature (for Japanese user)
|
||||||
|
Easymotion can match multibyte Japanese character with a alphabet input.
|
||||||
|
For example, '<Leader><Leader>fa' can search 'あ'.
|
||||||
|
This feature doesn't require cmigemo because Easymotion includes regex
|
||||||
|
patterns generated by cmigemo.
|
||||||
|
|
||||||
|
Add following description in your vimrc:
|
||||||
|
|
||||||
|
let g:EasyMotion_use_migemo = 1
|
||||||
|
|
||||||
|
Default:0
|
||||||
|
|
||||||
|
## Keep cursor column
|
||||||
|
Added keep cursor column option when JK motion.
|
||||||
|
|
||||||
|
Add following description in your vimrc:
|
||||||
|
|
||||||
|
let g:EasyMotion_startofline = 0
|
||||||
|
|
||||||
|
Default:0
|
||||||
|
|
||||||
|
## Jump to anywhere!
|
||||||
|
JumpToAnywhere motion!
|
||||||
|
|
||||||
|
Add following description in your vimrc and you can customize this behavior:
|
||||||
|
|
||||||
|
map <Space><Space> <Plug>(easymotion-jumptoanywhere)
|
||||||
|
let g:EasyMotion_re_anywhere = '\v' .
|
||||||
|
\ '(<.|^)' . '|' .
|
||||||
|
\ '(.$)' . '|' .
|
||||||
|
\ '(\l)\zs(\u)' . '|' .
|
||||||
|
\ '(_\zs.)' . '|' .
|
||||||
|
\ '(/\zs.)' . '|' .
|
||||||
|
\ '(#\zs.)'
|
||||||
|
|
||||||
|
## Select line
|
||||||
|
Added SelectLines function which allows you to select any range of lines using two consecutive easymotion calls. Default mappings are `c<Leader>l, d<Leader>l, v<Leader>l, y<Leader>l`(set `let g:EasyMotion_do_special_mapping = 1`, this function is disabled by default).
|
||||||
|
|
||||||
|
To yank a single line you can either type the same character(s) twice, or use '.' character. 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.
|
||||||
|
|
||||||
|
Select lines using `v<Leader>l`
|
||||||
|
|
||||||
|
![two-character key](http://homes.cs.washington.edu/~supasorn/easymotion2.gif)
|
||||||
|
|
||||||
|
Yank lines using `y<Leader>l`. You can copy lines without moving cursor back and forth between line you want to yank and line you want to paste.
|
||||||
|
|
||||||
|
![two-character key](http://homes.cs.washington.edu/~supasorn/easymotion3.gif)
|
||||||
|
|
||||||
|
## Select Phrase
|
||||||
|
(Experimental) Added SelectPhrase function which allows you to make selection between any two characters. Default mapping are `c<Leader>p, d<Leader>p, v<Leader>p, y<Leader>p`.(set `let g:EasyMotion_do_special_mapping = 1`, this function is disabled by default)
|
||||||
|
|
||||||
|
Example usage: type `v<Leader>p` then press two input characters. Now the two input characters will be highlight on the same screen, and you can then type two combos to make selection.
|
||||||
|
|
||||||
|
## \<Plug\> mapping support
|
||||||
|
But I keep backward compatibility, so you can easily move to new easymotion.
|
||||||
|
|
||||||
|
With this `<Plug>` support, I can easily implement new mapping without
|
||||||
|
confliction.Such as
|
||||||
|
|
||||||
|
- `<Plug>(easymotion-bd-w)`
|
||||||
|
- (bidirectional word motion)
|
||||||
|
- `<Plug>(easymotion-jumptoanywhere)`
|
||||||
|
- and others! See :h easymotion-more-mapping
|
||||||
|
|
||||||
|
|
||||||
|
Pull requests are welcome! :)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user