Coder Social home page Coder Social logo

kakoune-easymotion's Introduction

kakoune-easymotion

IRC

kakoune plugin for navigating like the easymotion vim mode

demo

Setup

Add easymotion.kak to your autoload directory,~/.config/kak/autoload, or source it manually.

Usage

The script defines a few commands:

  • easy-motion-f
  • easy-motion-w
  • easy-motion-W
  • easy-motion-j
  • easy-motion-alt-f
  • easy-motion-b
  • easy-motion-B
  • easy-motion-k
  • easy-motion-on-regex

It uses one option, em_jumpchars which defaults to a..z, and two faces, EasyMotionForeground and EasyMotionBackground. They default to red and light grey.

I don't suggest any particular mappings, but you could try:

map global user w :easy-motion-w<ret>
map global user W :easy-motion-W<ret>
map global user j :easy-motion-j<ret>

or use the provided easymotion user-mode.

License

Unlicense

kakoune-easymotion's People

Contributors

charlesgueunet avatar delapouite avatar ilikeavocadoes avatar listentolist avatar occivink avatar thenyeguy 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

Watchers

 avatar  avatar  avatar  avatar

kakoune-easymotion's Issues

Support vim-sneak like label mode (streak mode)

vim-sneak's label mode is a really nice alternative to easymotion, but I think (hope) it would be relatively easy to add as an option to this plugin.

https://github.com/justinmk/vim-sneak
justinmk/vim-sneak#58

The core difference is that instead of hitting the shortcut and then immediately being presented with a label on every word on the screen, you hit the shortcut and 2 chars, and then only the pairs of characters that match what you typed get labelled. In practice in neovim I (personally) find this much faster and more intuitive than Easymotion.

I'm interested in trying to put together a PR for this if I get time, but raising in case anyone else is interested.

`easy-motion-f` breaks when using `\t` as search character

Before:

 1│Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ac cursus nisl. Sed 
 1│quis suscipit quam. Pellentesque tortor turpis, dignissim quis facilisis eget,   
 2│euismod sed enim. Integer facilisis sapien vitae nibh lacinia laoreet. Donec ut  
 3│luctus diam. Proin vel faucibus mauris. Aenean elit ipsum, lobortis id pretium   
 4│non, fringilla vel neque. Proin elementum est sit amet ex placerat tempor. Nulla 
 5│non diam eleifend, finibus ipsum vitae, convallis metus. Maecenas in nulla       
 6│imperdiet, dictum massa eget, vulputate dolor. Morbi feugiat ipsum at lectus     
 7│ultricies porttitor. Aenean rhoncus rutrum auctor. Sed eget felis ut metus       
 8│suscipit maximus nec ac diam. Donec semper sem id mauris mattis, at ultrices     
 9│ante faucibus.                                                                   

After running easy-motion-f and pressing <tab>:

 1│acaeagaiakamaoaqasauawaybabcbebgbibkbmbobqbsbubwbycacccecgcickcmcocqcscucwcydadc 
 1│dfdhdjdldndpdrdtdvdxdzebedefehejeleneperetevexezfbfdfffhfjflfnfpfrftfvfxfzgbgd   
 2│gggigkgmgogqgsgugwgyhahchehghihkhmhohqhshuhwhyiaicieigiiikimioiqisiuiwiyjajcjet  
 3│jijkjmjojqjsjujwjykakckekgkikkkmkokqkskukwkylalclelglilklmlolqlslulwlymamcmemg   
 4│mjmlmnmpmrmtmvmxmznbndnfnhnjnlnnnpnrntnvnxnzobodofohojolonoporotovoxozpbpdpfphpj 
 5│pmpopqpspupwpyqaqcqeqgqiqkqmqoqqqsquqwqyrarcrergrirkrmrorqrsrurwrysascsesg       
 6│sjslsnspsrstsvsxsztbtdtfthtjtltntptrtttvtxtzubudufuhujulunupurutuvuxuzvbvdvf     
 7│vivkvmvovqvsvuvwvywawcwewgwiwkwmwowqwswuwwwyxaxcxexgxixkxmxoxqxsxuxwxyyayc       
 8│yfyhyjylynypyrytyvyxyzzbzdzfzhzjzlznzpzrztzvzxzzaabaaeaahaakaanaaqaataawaazs     
 9│abeabhabkabns.                                                                   

And it gets stuck in this state – you can move around the buffer with the normal mode keys and the characters don't change back – until you run another easy-motion-* command.

Support for opposite direction

Hi danr

Currently the plugin can only select forward. This is in part related to GE here and the order in which python iterate over descs.

exec -no-hooks <space>GE<a-\;>s %arg{1} <ret> "'" <a-:>

So maybe we could replace the existing 3 commands:

easy-motion-word
easy-motion-WORD
easy-motion-line

with:

# same behavior than now: going right/down
easy-motion-w
easy-motion-W
easy-motion-j

# new: opposite behavior going left/up
easy-motion-b
easy-motion-B
easy-motion-k

Bonus: vim-easymotion also has the concept of bidirectionnal but it's trickier to accomplish and should be in another PR.

error after install : 'echo' unknown option '-to-file'

Hello I just installed the plugin and this is the error I got after trying easy-motion-char and easy-motion-WORD :

*** This is the debug buffer, where debug info will be written ***
Config-change detected:
Config-change detected:
Error: 1:2: 'easy-motion-on-regex' 6:148: 'easy-motion-on-selections' 2:14: 'echo' unknown option '-to-file'
Error: 1:1: 'easy-motion-WORD' 1:2: 'easy-motion-on-regex' 6:148: 'easy-motion-on-selections' 2:14: 'echo' unknown option '-to-file'

Both command does selection of char or words, but throw the error right after.

Fails with "is not a number"

Trying easy-motion-f results in this error on Kakoune v2018.10.27.

Error: 1:2: 'easy-motion-on-regex' 3:62: 'easy-motion-on-selections' 3:304: 'eval' 1:1: 'select' 7\neasy-motion-rmhl\neasy-motion-addhl\nset is not a number

Kakoune hangs when running any easymotion command

Kakoune v2018.10.27
Python 3.6.7
Shell: dash-0.5.10

Commit that breaks it for me: 9098e0f

When running any easymotion command kakoune hangs and waits for some command to complete. I have to use <c-c> to stop the command. After this there's plenty of selections in the buffer, empty *pydef* buffer and some errors in debug

*** This is the debug buffer, where debug info will be written ***
Config-change detected:
Config-change detected:
error running hook ModeChange(insert:next-key)/: 2:6: 'set-option' no window in context
error running hook ModeChange(insert:normal)/: 2:6: 'set-option' no window in context

Broken on current master: easy-motion-on-selections ... too many values to unpack

Hello,

thanks for the great plugin,
I am using kakoune compiled from the git repository and it seems a bug have appeared somewhere in between b8eef and aad4612 (current master)
When triggering an easymotion command, I see corresponding targets selected (each lines for line mode, each word for word mode...) but no indicator.
Also, the debug buffer tells me:

easy-motion-on-selections -params 0..3 error: too many values to unpack (expected 2)

I can help debugging this if needed.

Charles

Update plugin

Breaking changes have been introduced in kakoune since this plugin was last updated, so it no longer works.

`easy-motion-f` not a true f replacement

No selection is made, and existing selection is deleted, when using :easy-motion-f. If it supported selections then this is a very nice drop in normal mode replacement for f.

Support jumpsequences

12:34 < ManDay> just would be good if the "jumpchars" were rather "jumpsequences"
12:34 < ManDay> so they'd make a number-system, counting like aa, ab, ac, ad, ba, bb, bc, bd, ca ... etc

Use POSIX shell syntax

I'm having an issue with easymotion where it expects me to have bash set as my shell but I use dash for non-interactive scripts (i.e. /bin/sh -> dash).

Would it be possible to refactor the code to use POSIX shell syntax?

I get this error currently /bin/sh: 2: /bin/sh: [[: not found which is due to POSIX shell not supporting double bracket expressions which are bash specific.

easymotion used to work for me but I tried using the latest master and it seems to have broken, I can't say when exactly it broke though.

my keys doesn‘t action.

I set "map global normal ': easy-motion-char' ", but is invalid.
Iset "map global normal <a-,> ': easy-motion-char' ", but is ok.

follow is my config:

plug "danr/kakoune-easymotion" config %{
    face global EasyMotionBackground rgb:000001
    face global EasyMotionForeground rgb:ee3a8c,rgb:000000+fg
    face global EasyMotionSelected yellow+b
}

map global normal <a-,> ': easy-motion-char<ret>'   // yes
map global normal <c-j> ': easy-motion-char<ret>'   // no

Kakoune hangs on easymotion when `python` is aliased to `python2`

When trying to use easymotion, it causes kakoune to hang, making it unresponsible to any user input and requiring a sigterm. As it turns out, easymotion tries to run the created script by calling python, which on Fedora 27 (and probably quite a few other systems) defaults to Python 2.7. This fails due to a syntax error.

According to PEP 394, this is the correct version to execute. Could the python executable used be changed to python3 to solve this, or would this create issues for other systems, thus requiring some kind of version checking?

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.