zed icon indicating copy to clipboard operation
zed copied to clipboard

Implement Leap Key Navigation

Open peter-wasilko opened this issue 1 year ago • 4 comments

Check for existing issues

  • [X] Completed

Describe the feature

Jef Raskin's design for the Canon Cat employed a quasi-mode for rapid navigation as illustrated in this YouTube Video.

This feature has also been requested in the helloSystem project repro.

Also, BitSavers has a copy of the Cat's Technical Documentation that may be of interest on this topic among others.

Finally, there was an attempted reimplementation in Python by Aza Raskin, Jef's son.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

peter-wasilko avatar Mar 15 '23 16:03 peter-wasilko

This is an interesting idea. I don't see how it's different from using cmd-f though (or //? in vim mode) -- could you explain further what makes this different from just searching?

Seems similar to zed-industries/zed#4930 and zed-industries/zed#5289 (it's a different execution of the same concept)

clo4 avatar Mar 18 '23 22:03 clo4

Plus one for this.

I prefer leap over hop and easymotion personally, as it is very natural; using the word prefix itself instead of random characters. With it, you trigger the command somehow and then press the two letters of the word you want the cursor to go, and all locations that match on screen get an indication. since you're looking at where you want to go, you press the key that marks the location, and your cursor jumps. Since only places with the two characters appear, the visual clutter is minimal.

Please see the readme at https://github.com/ggandor/leap.nvim

Other editors have this idea too, and bring new concepts to it. For instance, helix recently added goto_word mode.

This category of plugin speaks to the need for quickly moving the cursor visually without touching the mouse or changing modes.

clord avatar Apr 16 '24 19:04 clord

Currently, leap.nvim and oil.nvim are the two things I miss the most, in that order.

I like / for being stateful (cycling through matches) and global, but when you just need to jump to a certain place in a viewport (which I believe to be the most common motion), it seems like nothing does it better than leap.nvim at the moment.

mmosk avatar May 21 '24 09:05 mmosk

This is an interesting idea. I don't see how it's different from using cmd-f though (or //? in vim mode) -- could you explain further what makes this different from just searching?

Seems similar to #4930 and #5289 (it's a different execution of the same concept)

You can think of it like a poor-man's eye tracker because it serves the same functional purpose. If you are looking at a location in a vim buffer, you can get the cursor to that location by pressing no more than 2-3 keys (not including the start key). So you look at something, press 's', start typing what you are looking at, if there's ambiguity it'll temporarily put a "flag" character in the buffer you should type to disambiguate which site you are looking at. It feels like your editor is reading your mind. Completely replaces the need for touching the trackpad which is helpful for me because trackpad clicking gives me carpal tunnel.

willtalmadge avatar Aug 25 '24 04:08 willtalmadge

Here's a quick demo:

https://github.com/user-attachments/assets/ca821e97-3460-4923-925f-08cb6f5d341a

I'm pressing 's' to activate leap.

ninjarogue avatar Aug 28 '24 04:08 ninjarogue