Introducing quickscope.kak

Hi,

I have started using Kakoune half a year ago. I have used vim mostly before, but I can not say I am a vim poweruser by any means. Just some config file editing and so.

I try to use Kakoune the right way. This means using hjkl for moving and w, e and b for words and so. I try to go step-by-step, finding lame use cases and fixing them by training good habits.

I have noticed myself moving around lines hammering j and k, so I have tried to fix that
this way. I was able to set up my terminal to work with those bindings, but it only helped me with large jumps, and not within line movements.

Now I try to solve that with f and t, but it is quite hard to figure out the right jump char.
To solve this I have written a little plugin for myself:
quickscope.kak

Let me know if You find it useful and do not hesitate to report here or on Nest if I have messed up something.

Thank You!

4 Likes

Hi @Voroskoi! You can also consider using ModeChange hooks rather than mappings to enable/disable highlighting. The hook_param values are push:normal:next-key[to-char] and pop:next-key[to-char]:normal respectively for entering and exiting f/t/<a-f>/<a-t> from normal mode.

If you need to know what key was pressed to change modes, you can use a separate hook like this.

1 Like

Thanks for the tip, it is done.

Hi,

Couple changes, I do not plan to add any more feature to this plugin:

  • Fixed multibyte character highlighting.
  • Also introducing quickscope user mode which (when enabled) pops up a menu to for repeated calling without reentering search key. (Idea comes from fandt plugin by @listentolist)

Thanks!

1 Like