From c3d7bae21b88e3922deaca00f9d21d6ef5e1d4be Mon Sep 17 00:00:00 2001 From: haya14busa Date: Tue, 19 Jan 2016 03:04:05 +0900 Subject: [PATCH] Add document for overwin motions --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++ doc/easymotion.txt | 17 ++++++++++++---- 2 files changed, 64 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ec0f6c5..e03ad99 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,57 @@ Jeffrey Way of Nettuts+ has also [written a tutorial](http://net.tutsplus.com/tutorials/other/vim-essential-plugin-easymotion/) about EasyMotion. +New features in version 3.0 +==== + +### Overwin motions +![](https://raw.githubusercontent.com/haya14busa/i/2753bd4dd1dfdf5962dbdbffabf24244e4e14243/easymotion/overwin-motions.gif) + +EasyMotion now supports moving cursor across/over window. +Since it doesn't make sense that moving cursor to other window while Visual or +Operator-pending mode, overwin motions only provides mappings for Normal +mode. Please use `nmap` to use overwin motions. Overwin motions only +supports bi-directional motions. + +#### Example configuration + +```vim +" f{char} to move to {char} +map f (easymotion-bd-f) +nmap f (easymotion-overwin-f) + +" s{char}{char} to move to {char}{char} +nmap s (easymotion-overwin-f2) + +" Move to line +map L (easymotion-bd-jk) +nmap L (easymotion-overwin-line) + +" Move to word +map w (easymotion-bd-w) +nmap w (easymotion-overwin-w) +``` + +#### Integration with incsearch.vim + +```vim +" You can use other keymappings like instead of if you want to +" use these mappings as default search and somtimes want to move cursor with +" EasyMotion. +function! s:incsearch_config(...) abort + return incsearch#util#deepextend(deepcopy({ + \ 'modules': [incsearch#config#easymotion#module({'overwin': 1)], + \ 'keymap': { + \ "\": '(easymotion)' + \ }, + \ 'is_expr': 0 + \ }), get(a:, 1, {})) +endfunction + +noremap / incsearch#go(incsearch_config()) +noremap ? incsearch#go(incsearch_config({'command': '?'})) +noremap g/ incsearch#go(incsearch_config({'is_stay': 1})) +``` New features in version 2.0 ==== diff --git a/doc/easymotion.txt b/doc/easymotion.txt index a091fe8..f2dcfab 100644 --- a/doc/easymotion.txt +++ b/doc/easymotion.txt @@ -259,13 +259,13 @@ Bidirection ~ (easymotion-bd-n) *(easymotion-bd-n)* Jump to latest "/" or "?" forward. See |n| & |N|. - *easymotion-overwindow-motions* -Overwindow Motions~ + *easymotion-overwin-motions* +Overwin Motions~ -Overwindow motions supports moving cursor across/over |window|. Since it +Overwin motions supports moving cursor across/over |window|. Since it doesn't make sense that moving cursor to other window while |Visual| or |Operator-pending| mode, overwin motions only provides mappings for |Normal| -mode. Please use |nmap| to use overwin motions. Overwindow motions only +mode. Please use |nmap| to use overwin motions. overwin motions only supports bi-directional motions. (easymotion-overwin-f){char} *n_(easymotion-overwin-f)* @@ -327,6 +327,15 @@ For ovrewin n-character find motions~ noremap ? incsearch#go(incsearch_config({'command': '?'})) noremap g/ incsearch#go(incsearch_config({'is_stay': 1})) < + *easymotion-overwin-limitation* +Since archtecture of overwin motions is different from other easymotion +motions, there are some limitations. + + 1. |EasyMotion_do_shade| by default and currently you cannot turned off + this option. + 2. Highlight for target is always EasyMotionTarget (|EasyMotion_highlight|) + even for two key targets. + Jump To Anywhere ~ (easymotion-jumptoanywhere) *(easymotion-jumptoanywhere)*