Skip to content

Commit c3d7bae

Browse files
committed
Add document for overwin motions
1 parent 7578ffe commit c3d7bae

File tree

2 files changed

+64
-4
lines changed

2 files changed

+64
-4
lines changed

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,57 @@ Jeffrey Way of Nettuts+ has also [written
101101
a tutorial](http://net.tutsplus.com/tutorials/other/vim-essential-plugin-easymotion/)
102102
about EasyMotion.
103103

104+
New features in version 3.0
105+
====
106+
107+
### Overwin motions
108+
![](https://raw.githubusercontent.com/haya14busa/i/2753bd4dd1dfdf5962dbdbffabf24244e4e14243/easymotion/overwin-motions.gif)
109+
110+
EasyMotion now supports moving cursor across/over window.
111+
Since it doesn't make sense that moving cursor to other window while Visual or
112+
Operator-pending mode, overwin motions only provides mappings for Normal
113+
mode. Please use `nmap` to use overwin motions. Overwin motions only
114+
supports bi-directional motions.
115+
116+
#### Example configuration
117+
118+
```vim
119+
" <Leader>f{char} to move to {char}
120+
map <Leader>f <Plug>(easymotion-bd-f)
121+
nmap <Leader>f <Plug>(easymotion-overwin-f)
122+
123+
" s{char}{char} to move to {char}{char}
124+
nmap s <Plug>(easymotion-overwin-f2)
125+
126+
" Move to line
127+
map <Leader>L <Plug>(easymotion-bd-jk)
128+
nmap <Leader>L <Plug>(easymotion-overwin-line)
129+
130+
" Move to word
131+
map <Leader>w <Plug>(easymotion-bd-w)
132+
nmap <Leader>w <Plug>(easymotion-overwin-w)
133+
```
134+
135+
#### Integration with incsearch.vim
136+
137+
```vim
138+
" You can use other keymappings like <C-l> instead of <CR> if you want to
139+
" use these mappings as default search and somtimes want to move cursor with
140+
" EasyMotion.
141+
function! s:incsearch_config(...) abort
142+
return incsearch#util#deepextend(deepcopy({
143+
\ 'modules': [incsearch#config#easymotion#module({'overwin': 1)],
144+
\ 'keymap': {
145+
\ "\<CR>": '<Over>(easymotion)'
146+
\ },
147+
\ 'is_expr': 0
148+
\ }), get(a:, 1, {}))
149+
endfunction
150+
151+
noremap <silent><expr> / incsearch#go(<SID>incsearch_config())
152+
noremap <silent><expr> ? incsearch#go(<SID>incsearch_config({'command': '?'}))
153+
noremap <silent><expr> g/ incsearch#go(<SID>incsearch_config({'is_stay': 1}))
154+
```
104155

105156
New features in version 2.0
106157
====

doc/easymotion.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,13 @@ Bidirection ~
259259
<Plug>(easymotion-bd-n) *<Plug>(easymotion-bd-n)*
260260
Jump to latest "/" or "?" forward. See |n| & |N|.
261261

262-
*easymotion-overwindow-motions*
263-
Overwindow Motions~
262+
*easymotion-overwin-motions*
263+
Overwin Motions~
264264

265-
Overwindow motions supports moving cursor across/over |window|. Since it
265+
Overwin motions supports moving cursor across/over |window|. Since it
266266
doesn't make sense that moving cursor to other window while |Visual| or
267267
|Operator-pending| mode, overwin motions only provides mappings for |Normal|
268-
mode. Please use |nmap| to use overwin motions. Overwindow motions only
268+
mode. Please use |nmap| to use overwin motions. overwin motions only
269269
supports bi-directional motions.
270270

271271
<Plug>(easymotion-overwin-f){char} *n_<Plug>(easymotion-overwin-f)*
@@ -327,6 +327,15 @@ For ovrewin n-character find motions~
327327
noremap <silent><expr> ? incsearch#go(<SID>incsearch_config({'command': '?'}))
328328
noremap <silent><expr> g/ incsearch#go(<SID>incsearch_config({'is_stay': 1}))
329329
<
330+
*easymotion-overwin-limitation*
331+
Since archtecture of overwin motions is different from other easymotion
332+
motions, there are some limitations.
333+
334+
1. |EasyMotion_do_shade| by default and currently you cannot turned off
335+
this option.
336+
2. Highlight for target is always EasyMotionTarget (|EasyMotion_highlight|)
337+
even for two key targets.
338+
330339
Jump To Anywhere ~
331340

332341
<Plug>(easymotion-jumptoanywhere) *<Plug>(easymotion-jumptoanywhere)*

0 commit comments

Comments
 (0)