Code Monkey home page Code Monkey logo

vim-easymotion's Introduction

Vim motion on speed!

Build Status reviewdog

Animated demonstration

About the authors

Authors
Kim Silkebækken https://github.com/Lokaltog
haya14busa https://github.com/haya14busa

The EasyMotion project, revived!

Starting from version 2.0 haya14busa will be taking over the project from Lokaltog. He's improved the default motions, implemented many useful new features, and fixed some bugs.

EasyMotion is now completely:

  • Well-behaved: It's consistent with the default motions of Vim and works well in all modes. And it now supports repeating with the dot operator.
  • Configurable: You can easily configure its behavior and map it to any key
  • Sophisticated: Provide flawless, smooth and fast motions with minimal keystrokes

Even though some default behaviors were modified and many new features were added, I carefully considered backward compatibility. So those of you updating from older versions can do so without worry and start benefiting immediately from all the new features!

Introduction

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 highlighting all possible choices and allowing you to press one key to jump directly to the target.

When one of the available motions is triggered, all visible text preceding or following the cursor is faded, and motion targets are highlighted.

EasyMotion is triggered by the provided mappings. This readme only covers the basics; please refer to :help easymotion.txt to see all the available mappings.

Important notes

Default bindings

The default leader has been changed to <Leader><Leader> to avoid conflicts with other plugins you may have installed. This can easily be changed back to pre-1.3 behavior by rebinding the leader in your vimrc:

map <Leader> <Plug>(easymotion-prefix)

All motions will then be triggered with <Leader> by default, e.g. <Leader>s, <Leader>gE.

For users of the forked version

SelectLines and SelectPhrase are not actually motions, so I've moved them into separate plugins.

Usage example for the base features

<cursor>Lorem ipsum dolor sit amet.

Type <Leader><Leader>w(<Plug>(easymotion-w)) to trigger the word motion w. When the 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.

Press c to jump to the beginning of the word "sit":

Lorem ipsum dolor <cursor>sit amet.

Similarly, if you're looking for an "o", you can use the f motion. Type <Leader><Leader>fo, and all "o" characters are highlighted:

<cursor>L{a}rem ipsum d{b}l{c}r sit amet.

Press b to jump to the second "o":

Lorem ipsum d<cursor>olor sit amet.

Jeffrey Way of Nettuts+ has also written a tutorial about EasyMotion.

New features in version 3.0

Overwin motions

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

" <Leader>f{char} to move to {char}
map  <Leader>f <Plug>(easymotion-bd-f)
nmap <Leader>f <Plug>(easymotion-overwin-f)

" s{char}{char} to move to {char}{char}
nmap s <Plug>(easymotion-overwin-f2)

" Move to line
map <Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader>L <Plug>(easymotion-overwin-line)

" Move to word
map  <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)

Integration with incsearch.vim

" You can use other keymappings like <C-l> instead of <CR> if you want to
" use these mappings as default search and sometimes want to move cursor with
" EasyMotion.
function! s:incsearch_config(...) abort
  return incsearch#util#deepextend(deepcopy({
  \   'modules': [incsearch#config#easymotion#module({'overwin': 1})],
  \   'keymap': {
  \     "\<CR>": '<Over>(easymotion)'
  \   },
  \   'is_expr': 0
  \ }), get(a:, 1, {}))
endfunction

noremap <silent><expr> /  incsearch#go(<SID>incsearch_config())
noremap <silent><expr> ?  incsearch#go(<SID>incsearch_config({'command': '?'}))
noremap <silent><expr> g/ incsearch#go(<SID>incsearch_config({'is_stay': 1}))

Bonus fuzzy-search with EasyMotion

function! s:config_easyfuzzymotion(...) abort
  return extend(copy({
  \   'converters': [incsearch#config#fuzzyword#converter()],
  \   'modules': [incsearch#config#easymotion#module({'overwin': 1})],
  \   'keymap': {"\<CR>": '<Over>(easymotion)'},
  \   'is_expr': 0,
  \   'is_stay': 1
  \ }), get(a:, 1, {}))
endfunction

noremap <silent><expr> <Space>/ incsearch#go(<SID>config_easyfuzzymotion())

New features in version 2.0

Two key highlighting

When EasyMotion runs out of single characters to highlight movement targets, it immediately shows you the keys you have to press.

In previous versions you could not see the next character you would need to press until you entered the first one. This made movement over long distances less fluid. Now you can see at a glance exactly which characters to select to get to your destination.

Bidirectional motions

All motions now come in bidirectional variants (e.g. <Plug>(easymotion-s), <Plug>(easymotion-bd-w) and so forth). By default, you can already jump forward or backward with <Leader>s. A useful trick is to map nmap s <Plug>(easymotion-s) to use s instead and save one keystroke!

2-character search motion

You can now also perform a 2-character search, similar to vim-seek/vim-sneak with <Plug>(easymotion-s2). For example, you can highlight all words that start with fu.

2-key-find-motion

" Gif config
nmap s <Plug>(easymotion-s2)
nmap t <Plug>(easymotion-t2)

n-character search motion

You can also search for n characters, which can be used to replace the default search of Vim. It supports incremental highlighting and you can use <Tab> and <S-Tab> to scroll down/up a page. If you press <CR>, you get the usual EasyMotion highlighting and can jump to any matching target destination with a single keystroke.

What sounds complicated should become clear if you look at the following examples.

n-key-motion-scroll

replace-search

" Gif config
map  / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)

" These `n` & `N` mappings are options. You do not have to map `n` & `N` to EasyMotion.
" Without these mappings, `n` & `N` works fine. (These mappings just provide
" different highlight method and have some other features )
map  n <Plug>(easymotion-next)
map  N <Plug>(easymotion-prev)

Within line motion

Every motion also has variants that are restricted to just the current line (e.g. <Plug>(easymotion-sl), <Plug>(easymotion-bd-wl), etc...). This can be helpful if you find the full search distracting or slows down vim.

hjkl motions

EasyMotion can be configured to avoid repetitive use of the h j k and l keys.

hjkl-motion

" Gif config
map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)

let g:EasyMotion_startofline = 0 " keep cursor column when JK motion

Smartcase & Smartsign

This setting makes EasyMotion work similarly to Vim's smartcase option for global searches.

let g:EasyMotion_smartcase = 1

With this option set, v will match both v and V, but V will match V only. Default: 0.

let g:EasyMotion_use_smartsign_us = 1 " US layout
" or
let g:EasyMotion_use_smartsign_jp = 1 " JP layout

This applies the same concept, but for symbols and numerals. 1 will match 1 and !; ! matches ! only. Default: 0.

Migemo feature (for Japanese user)

let g:EasyMotion_use_migemo = 1

Easymotion can match multibyte Japanese characters with alphabetical input. For example, <Leader><Leader>sa can search 'あ'. This feature doesn't require cmigemo because Easymotion includes regex patterns generated by cmigemo. However, installing cmigemo will make 2-character and n-character search motions to also support the migemo feature. Default:0

Repeat motions

Repeat the last motion

<Plug>(easymotion-repeat)

Repeat the last find motion

In a find motion (e.g. <Plug>(easymotion-s)), type <CR> without input characters to find the last motion again.

Jump to next/previous match (even on next/previous page)

  • <Plug>(easymotion-next)
  • <Plug>(easymotion-prev)

Support for dot repeat

This requires https://github.com/tpope/vim-repeat.

You can use EasyMotion with operators and press . to repeat! It is well-behaved and consistent with the default behavior of Vim.

repeat-motion

" Gif config

" Require tpope/vim-repeat to enable dot repeat support
" Jump to anywhere with only `s{char}{target}`
" `s<CR>` repeat last find motion.
nmap s <Plug>(easymotion-s)
" Bidirectional & within line 't' motion
omap t <Plug>(easymotion-bd-tl)
" Use uppercase target labels and type as a lower case
let g:EasyMotion_use_upper = 1
 " type `l` and match `l`&`L`
let g:EasyMotion_smartcase = 1
" Smartsign (type `3` and match `3`&`#`)
let g:EasyMotion_use_smartsign_us = 1

Installation

git clone https://github.com/easymotion/vim-easymotion ~/.vim/bundle/vim-easymotion
Plugin 'easymotion/vim-easymotion'
NeoBundle 'easymotion/vim-easymotion'
Plug 'easymotion/vim-easymotion'
git clone https://github.com/easymotion/vim-easymotion.git ~/.vim/pack/plugins/start/vim-easymotion

Minimal Configuration Tutorial

I recommend configuring and map keys by yourself if you are true Vimmer.

Please do not be satisfied with just installing vim-easymotion, configuring it yourself boost your productivity more and more!

Default <Leader><Leader> prefix isn't easy to press, and I leave them just for backwards compatibility. You should at least change the prefix key like this map <Leader> <Plug>(easymotion-prefix)

Minimal but useful vimrc example:

let g:EasyMotion_do_mapping = 0 " Disable default mappings

" Jump to anywhere you want with minimal keystrokes, with just one key binding.
" `s{char}{label}`
nmap s <Plug>(easymotion-overwin-f)
" or
" `s{char}{char}{label}`
" Need one more keystroke, but on average, it may be more comfortable.
nmap s <Plug>(easymotion-overwin-f2)

" Turn on case-insensitive feature
let g:EasyMotion_smartcase = 1

" JK motions: Line motions
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)

Now, all you need to remember is s and JK motions bindings, and it's good enough to boost your cursor speed!

s is bidirectional find motion, you can move to anywhere with it.

<Leader>j & <Leader>k make it easy to move to the lines.

Of course, you can use any key you want instead of s such as <Space>, <Leader>s, etc...

If you want to use more useful mappings, please see :h easymotion.txt for more detail.

vim-easymotion's People

Contributors

arsenerei avatar awtom avatar blueyed avatar cht8687 avatar dasich avatar funguscolander avatar haya14busa avatar joshtch avatar kmorihiro avatar layzie avatar lfdm avatar lhassan18 avatar lokaltog avatar mathstuf avatar mdhooge avatar mikehaertl avatar modal avatar n-p-e avatar nelstrom avatar oflisback avatar sahands avatar shougo avatar somini avatar supasorn avatar takac avatar thornycrackers avatar trayo avatar trevors avatar vadskye avatar yggdrasii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-easymotion's Issues

hilighting issue

Hi, the plugin seems to be working, but I don't get the highlight coloring. I have tried changing the color scheme but It does not help.

Highlight the whole viewport instead

I really like this extension but the most annoying part that make it not too usable is, it just highlight the text from the current position of cursor to the end of the viewport. So everytime I have to H to go the top of the viewport then activate the plugin.

Is there anyway to make it highlight the whole viewport by default ?

Porting EasyMotion to Python?

I've been thinking about reviving this project lately. The main reason why I haven't been updating it in ages is because it's written in vimscript, and I'd rather stick a fork in my eye than ever having to write a line of vimscript again. I know that there's a bit of resistance in the community regarding using vim's excellent Python/Ruby/etc bindings because they introduce dependencies that some users don't like, but I think the benefits definitely outweigh the drawbacks.

I suspect the reason why many other big vim plugins grow stagnant and die over time, is for the same reason. If you have a vim plugin that works fairly well you'd rather not dive into the vimscript code to try to fix or implement anything new unless you have a really good reason to. With other languages it can be very fun to implement new functionality, but my experience with EasyMotion and the vim version of Powerline has been that it's mostly painful to maintain vimscript, and not something I look forward to.

By porting EasyMotion to Python I can see the following pros/cons:

Cons:

  • Python dependency.

Pros:

  • Vastly improved performance.
  • Much less code.
  • Much easier to maintain.
  • Much more fun to maintain(!)
  • Possible to implement many cool new features. Multi-colored multi-letter jump targets, improved tree algorithms, new motions, etc. are just some ideas I have.

I'd like your feedback on this, and also your ideas on new functionality if the plugin is going to be rewritten.

Showing the second character for far-away motion

First of all, I really enjoy the new SCTree algorithm. I think this is a nice improvement because motion is even more straightforward!

Another nice improvement would be to display the second character that is needed for 2-character movements to make the motion even more smooth!
However I'm aware there are some drawbacks for that, especially when using F and T motions. But for word motions, it must be feasible (well, I didn't look at the code ;-) )

Thanks again

Moving through folds

When lines are folded, and I try to move (specifically using j and k, don't remember if I tried other motions),
easy-motion doesn't recognise the lines, and either allows me to get one line above or below the fold.

Please help;)

It's possible to map `w` without break it as text object?

(Please, excuse my English :S)

Hi,

As I commented, I replaced the default f behaviour, and all posible motions with EasyMotion, but w gave me problems with things like cw which doesn't works anymore. It's an EasyMotion bug? Or when I map a key it works that way independently if it's a motion or an object?

Cannot allocate color none

Just tried using 1.0.7 and I get the following errors (using gvim in windows):

Error detected while processing function <SNR>72_InitHL:
line    7:
E254: Cannot allocate color none
E254: Cannot allocate color none
E254: Cannot allocate color none
E254: Cannot allocate color none

I also cleared out all of my config options/plugins and still get the same issue. Here's my vim info:

:version
    VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Mar  4 2011 10:05:23)
    MS-Windows 32-bit GUI version with OLE support
    Included patches: 1-138
    Compiled by Yongwei@Shanghai
    Big version with GUI.  Features included (+) or not (-):
    +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv +cscope +cursorbind +cursorshape 
    +dialog_con_gui +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -footer +gettext/dyn -hangul_input +iconv/dyn +insert_expand +jumplist 
    +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +lua/dyn +menu +mksession +modify_fname +mouse +mouseshape +multi_byte_ime/dyn +multi_lang -mzscheme +netbeans_intg +ole -osfiletype 
    +path_extra +perl/dyn +persistent_undo -postscript +printer -profile +python/dyn +python3/dyn +quickfix +reltime +rightleft +ruby/dyn +scrollbind +signs +smartindent -sniff +startuptime +statusline 
    -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white +tcl/dyn -tgetent -termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace 
    +wildignore +wildmenu +windows +writebackup -xfontset -xim -xterm_save +xpm_w32 
    system vimrc file: "$VIM\vimrc"
        user vimrc file: "$HOME\_vimrc"
    2nd user vimrc file: "$VIM\_vimrc"
        user exrc file: "$HOME\_exrc"
    2nd user exrc file: "$VIM\_exrc"
    system gvimrc file: "$VIM\gvimrc"
        user gvimrc file: "$HOME\_gvimrc"
    2nd user gvimrc file: "$VIM\_gvimrc"
        system menu file: "$VIMRUNTIME\menu.vim"
    Compilation: cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32   -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG   -DFEAT_XPM_W32   -DWINVER=0x0400 -D_WIN32_WINNT=0x0400  /Fo.\ObjGOULYHTR/ /Wp64 /Ox -DNDEBUG  /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DGLOBAL_IME -DFEAT_MBYTE -DFEAT_GUI_W32 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl84.dll\" -DDYNAMIC_TCL_VER=\"8.4\" -DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua51.dll\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python31.dll\" -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl512.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=191 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby191.dll\" -DFEAT_BIG /Fd.\ObjGOULYHTR/ /Zi
    Linking: link /RELEASE /nologo /subsystem:windows oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib  comdlg32.lib ole32.lib uuid.lib /machine:i386 /nodefaultlib gdi32.lib version.lib   winspool.lib comctl32.lib advapi32.lib shell32.lib  /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib  user32.lib   /nodefaultlib:lua51.lib   /nodefaultlib:python27.lib /nodefaultlib:python31.lib   C:\Tcl\lib\tclstub84.lib WSock32.lib C:\Libraries\xpm\lib\libXpm.lib /PDB:gvim.pdb -debug

plugin slows down entering command mode via ':'

ever since installing vim-easymotion, it takes a few seconds to jump to command mode after hitting :....

you can see that easymotion has a few things mapped globally via : from running ':verbose map :'

v :call * EasyMotionE(1, 0)
Last set from ~/.vim/bundles/vim-easymotion/plugin/EasyMotion.vim
o :call * EasyMotionE(0, 0)
Last set from ~/.vim/bundles/vim-easymotion/plugin/EasyMotion.vim
n :call * EasyMotionE(0, 0)
Last set from ~/.vim/bundles/vim-easymotion/plugin/EasyMotion.vim

I believe those spots are the culprit. I'll try forking to see if I can fix.

Norwegian characters trick highlighting

If a word in the text starts with æ, ø or å the highlighting is disturbed from the next word on. The highlighted character is the second or third character in the word. Some words aren't highlighted at all.

See the following picture. The last sentence of the second paragraph contains some Norwegian gibberish.
Without EasyMotion

In the following picture <Leader>w is started.
Without EasyMotion
From the first word after "øl", the highlighting is incorrect. E.g. the 'g' is highlighted instead of the 'v' in 'og'. 'øser' isn't highlighted at all, nor is is the word changed to show the target key. But if I press 'w', which is the correct target key, the cursor moves to the first character of the word.

After 'øser', 'og' and 'ærlige' are correctly changed to show the target key but the highlighting is wrong. On the word 'mennesker' the target key is put on the second character instead of the first and the highlighting is moved to the third character. Again, pressing 'z' takes me to the first character of the word. From the next line on, everything is correct.

Long story short: The movements are always correct; the highlighting is disturbed, but only is the character starts with æ, ø or å. I am guessing there is a regex somewhere that messes things up. I'm not very good with Vimscript. I'll try to take a look at it when I have the time.

PS: The same bug is also induced with also happens with ä, ö, é and è.

Make EasyMotion work following `c`, `d` and `y` commands

It would be great if you could use EasyMotion following the commands that accept a motion, namely change (c), delete (d) and yank (y) (and the other orange colored keys on the graphical cheat sheet). At the moment, if you try to use an EasyMotion mapping after any of these commands, nothing happens.

I've had a go at creating mappings for operator-pending mode with this patch. It almost works. You can now use EasyMotion after c, d and y commands, but it seems to stop short by one character, or by one line for the linewise operations.

no colors with split windows

Thank you for this very useful script :)

There seem to be a problem with split windows:

  • single window works fine and letters with color appear when activating easymotion
  • with two windows, when activating easymotion only the letters appear but color is not changed

1.Press :vs in normal mode to create a new window with any file.
2.Press w in any window to activate easymotion.

Script version is 1.2 on windows xp

Proofreading and feedback needed

English isn't my first language, so I'm sure that there are grammatical errors and room for language improvement in both the docs and the readme file. It would be great if an English-speaking grammar nazi could proofread the docs/readme and provide general feedback on the docs. :)

splitting keys in two different groups for far-away motion

Hi,
I was thinking it could be a good idea to split the keys in two grous. One used for the close motions and the other one for the far away one.
With this , I wouldn't have to wait to know if I would need to press a new key or if could start working.

Something which can be done too (or instead), is to have a different hilight for the close motion target and the far away one.

I would probably split the keys that way
close_keys = "fjdksla;"
far_keys = "FJDKSLA:"

Feature Request: Repeat last last motion type

Often times I will perform something like: <leader><leader>fa to highlight all the next letter As on the page, I will want to repeat that again.

I think a slick way to do this would be to map <leader><leader><leader> to display a batch of matches based on the last entered entered map. I don't want it to include the same chosen movement, however.

Incompatibility with CSApprox

I spent quite a bit of time to figure out what was screwing my terminal colors. It's easymotion wit CSApprox. Easymotion includes a fix for that but the catch is that you must have CSApprox already loaded when easymotion is loaded. I think that should go into documentation/requirements: "If you use CSApprox, be sure to load easymotion afterwards"

Thank you
Federico

Problem with non-ascii motion keys

While experimenting with the most efficient keys mapping for my own keyboard layout :-D , I've found that some utf-8/non-ascii keys (just a guess) are badly handled; and also the & character.

With the following configuration.
let g:EasyMotion_keys = '&é"''(-è_çà)=azertyuiop$qsdfghjklmù*<wxcvbn,;:!'

The & char is correctly taken into account but not displayed (the original character is highlighted instead).

And I think the algorithm is disturbed by 2-byte characters. When words are separated by a single whitespace, either the red highlight is missing or the motion key is offset by one character.

Not annoying at all, but if it could be corrected, that'd be nice!
Thanks

Replacing default behavior.

@Lokaltog
What would be the best and safest way to do this? Replace default behavior I mean.

Instead of pressing <leader><leader>f (it's how I like it) how can I make it just accept f and be done with it?

When I tried doing the following

let g:EasyMotion_leader_key=''

It broke navigation, because it apparently also uses keys like j etc.

So once again, what would be the safest way to replace default navigation with this? Only the search forward/backwards features. So that I can press f and it will launch EasyMotion instead of the default.

"Press ENTER" message after I select pace to move

Hi. I installed plugin thru Vundle. My current .vimrc is following: https://github.com/iAdramelk/.dotfiles/blob/master/vimrc

Every time then I select place to move, for example w then L , following dialog appears:

EasyMotion: Jumping to [222, 41]                                                                                                                                              
Press ENTER or type command to continue      

There is no such behavior in EasyMotion demo at it's repo. So I'm assuming that there is some bug in my config. But even if I disable all plugins and set options bug still persists.

Is there is a way to fix this behavior?

backward and forward

Hi,
would it be possible to jump backward and forward at the same time ?
I mean rather than having to chose before if I want to go backward or forward (f or F for example) would that not be easier to have back/forward move showing all the possibilties?
I'm not saying replacing the current behavior with that, but having a function so I can map it.

Highlight when moving backwards

Hi, whenever I try to use the 'b', 'B', 'ge' or 'gE' the highlight doesn't work properly - it still highlights from top to bottom instead of bottom to top

Some words are highlighted in an illegible, unintended way

When I search for the character 'p' in my .vimrc, some of the words with 'p' in them are changed to have a red background, which makes it very difficult to see the target letters in them. See below:

Just start at line 1 column 1 and press \fp to get this result:
screen shot 2014-01-09 at 8 32 06 pm

As far as I can tell, the word "filetype" should be the same color with the same background color as all the other words with just the letter p in red.

I distilled the issue down to an extremely minimal vim setup.

The entire .vimrc is three lines:

set nocompatible
filetype plugin on
syntax enable

The .vim directory structure in its entirety:

+---.vim
|   +---autoload
|       \---EasyMotion.vim
|   +---doc
|       \---easymotion.txt
|   +---plugin
\       \---EasyMotion.vim

I cloned the repository just an hour ago or so: 667a668

I tested this in MacVim 7.4 and Windows gVim 7.4.

word movements are inconsistent with the vim ones

Hi.
I found out that points that the plugin marks as jump points when moving by word movements differ from corresponding vim ones.
For default iskeyword vim w would stop at ^ for the next line when moving from the beginning:
some_var^=^some_val
while the plugin happens to mark only second ^ as possible jump point.

When I saw this discrepacy for the first time I thorougly(I thought so (() read the vim manual and
decided that the plugin behaviour correspods to what is written and even post a bug to vim-dev )
And it turns out that I misread the manual. Probably you too ))

New feature requests?

Hi, superb plugin! I can't imagine myself without him atm.
I'm not sure this is the place for it, but here goes anyway;)

I have a few suggestions that might improve this plugin:
- Keep the cursor position when going up/down (j and k move to the beginning of the line, instead of maintaining its position)
- Enable repeat movement for f,F,t,T (like the normal movement, using ; and ,) to move one step further ahead
- Repeat the last movement like the default, preferably repeat the movement using ; or , (like in repeat-motion plugin)

If these things are somehow implemented already, I would love to head about it
otherwise I would love to see these in future releases of this plugins

Thanks

Support backspace for grouped targets

When jumping, hitting the wrong key can cause a group to be selected. Being able to use backspace to jump back to the previous set would be nice.

Corner cases:

  • Backspacing to undo a final selection isn't necessary (<C-o> should handle that nicely enough).
  • Backspacing with no previous character -> cancel.

no fading, and no higlihting at all

I can only see letter marks that i should type to jump, jumping works and all.. but there is no highlighting (red), nor there is fading of the rest of the text in vim buffer. what could be wrong. thanks

Easymotion does not work with fold

1234 asdf
" Define language {{{1
set termencoding=utf-8
set encoding=utf-8
set langmenu=en_US.utf-8
language message en_US.utf-8

" Syntax {{{1
if !exists("g:syntax_on")
    syntax on
endif
filetype plugin indent on

let g:global_colors_name = "molokai"
if !exists("g:colors_name")
    exec "colorscheme " . g:global_colors_name
endif

Copy this source into a buffer.
Keep define language fold close and syntax fold open.
type gg0
type \w(leader is \)
You will find that syntax fold will open.

"No matching buffer" on paths with a + in them.

I noticed that EasyMotion pops me this odd error when I use it on a certain project:

Error detected while processing function EasyMotion#WB..<SNR>79_EasyMotionn..<SNR>79_VarReset:
line     9:
E94: No matching buffer for dropbox\+robotics\ideas.txt

I tried it on a plethora of other files and it all worked fine except on the folders which I begin with a + (as a marker for current projects).

can't perform reverse jumps

It would be nice to be able to jump to area before(above) the cursor, unfortunately all I can do is jump to areas after the cursor.

Either this is a bug or a feature that really needs to be a part for easymotion.

blockwise operator-pending motion f and t eat one more column.

When I have the following text:

const int i = 0;
const int j = i + 1;

cursor is on the first column in the first line

I start with  dCTRL-V<leader><leader>ti :

const⒜int⒝i = 0;
const⒞int j =⒟i + 1;

Hitting c, I expect to get:

int i = 0;
int j = i + 1;

However what I get is:

nt i = 0;
nt j = i + 1;

In summary, when starting with d^V, the motion eats up one additional column. Same with <leader><leader>f.

use one letter access for closest hit

Hi,
would it be possible to make the first hits only need one letters even though many target are available. What I am thinking is for example, using the lower case for the first 26 targets and then use upper case to select "groups".
so rather than being labelled that way
aa ab ... aZ
ba bb ... bZ
...
Za Zb ... ZZ
target would be labelled

a b ... z
Aa Ab ... Az
Ba Bb ... Bz
Za ... Zz
AAa ... AAz etc ...

Doesn't work in Kubuntu 10.04

I've installed easymotion as usually but there are few errors
this is the stack trace

Error detected while processing /home/sultan/.vim/plugin/EasyMotion.vim:
line 5:
E492: Not an editor command: ^M
line 7:
E15: Invalid expression: exists('g:EasyMotion_loaded') || &compatible || version < 702^M
line 30:
E488: Trailing characters
line 31:
E488: Trailing characters
line 32:
E488: Trailing characters
line 33:
E488: Trailing characters
line 34:
E488: Trailing characters
line 36:
E488: Trailing characters
line 37:
E488: Trailing characters
line 395:
E170: Missing :endfor
Press ENTER or type command to continue

Support for forward + backword motions

Hi, I really love the plugin, its just awesome :D

I frequently like to move to a place not depending on my cursor's position, and thought that a feature which finds a alphabet/sign in the current showing screen would be awesome.
Are there anyway to do that with the current api? :o

Documentation on option EasyMotion_do_mapping is very confusing

The documentation for EasyMotion_do_mapping tells us:

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.

Maybe I'm just dense, but I interpreted this as telling me that I need to set this option to 0 in order to customize the mappings using the EasyMotion_mapping_ variables. In fact it has the opposite effect, and actually prevents any custom mappings set with these variables from working. Apparently "disabling the default mappings" means something very different from "customizing the default mappings". In fact disabling the default mappings actually PREVENTS you from setting your own custom mappings (at least using the EasyMotion_mapping_ variables). Please clarify this in the documentation so that others like me don't become confused! Otherwise thanks for a great plugin.

Feature request: jump to anywhere

I find myself wondering, why do I have to think about what I'm jumping to, start of word, character etc. Why can't I just hit leader leader and then have every non-white character on the page indexed to jump to? When I'm using easymotion I want to look at the point where I want to jump and then keep typing the letters that I see there until the cursor appears. OK, you can achieve this to some extent using leader leader f or leader leader F but you still have to think about where your cursor is (do I have to go forwards or backwards). Why not cut out the thinking completely?

accented letters are leading to wrong targets

Word motions lead to wrong targets when there are two or more accented letters on the way ahead.

Example:

e é isso aí meu amigo!

If the cursor is on the first letter ('e') and the Leader+w is called,
easymotion will wrongly show targets before the 'meu' and 'amigo' words. Also
note that Leader+e, Leader+b and Leader+ge will also have problems.

Undo does not work correctly.

First, I must say thank you. This script is really life changing to me.

But it seems that undo undoes edit 2 times after operator-pending modification.

1.Press dd in normal mode.
2.Press d<leader>fxa to delete to first x occurrence.
3.Press u one time undoes not only d<leader>fxa but dd effect too.

Script version is 1.2

highlighting doesn't work with iTerm and CSApprox

Thanks for putting together an excellent and useful plugin. I am running MacVim (snapshot 62) on iTerm using the xterm-256color terminal type in MacOS Snow Leopard. When I use easymotion in the GUI version of MacVim, the red highlighting works great, but in the terminal, there is no highlighting at all. It looks like there is an assumption in the autoload file that CSApprox will use the gui settings, but this doesn't seem to be happening. If I unload CSApprox, the highlighting works great. Any thoughts?

Use different highlighting for group jumps

A form of visual feedback should indicate whether a jump target is a single-key jump or a group. E.g. highlighting single-key jumps in green and groups in red. This should be implemented as a configurable option (enabled by default).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.