zed icon indicating copy to clipboard operation
zed copied to clipboard

Flash.nvim style search in a document.

Open stephen776 opened this issue 1 year ago β€’ 18 comments

Check for existing issues

  • [X] Completed

Describe the feature

Flash lets you search and jump to Text inside a file by appending jump labels as you type search text.

it is an incredibly fast way to jump the cursor to specific places and would be an excellent addition to vim mode in Zed.

stephen776 avatar Jul 19 '24 10:07 stephen776

Hi @stephen776, interesting. So as I understand this, when searching in vim mode it dynamically creates "labels" which are appended inline following matches to allow you to quickly jump to that match if you type those letters rather than typing the vim pattern. These labels appear to be generated dynamically to not conflict with any characters that could following your current pattern. Additionally, it appears to support having the same labels for block starts/end (I assume using tree-sitter)?

What happens if you hit a typo that matches a label? Would this only be possible in vim mode or do you thin kit would be possible to support this in non-vim modes?

Can you say a little bit more about how you use this feature and why you find it so powerful?

notpeter avatar Jul 19 '24 13:07 notpeter

Yep that's correct. As for the typo/tag question, as soon as you press a tag it jumps to it. However, I think that it will attempt to avoid tags that are legitimate next character matches for potential overall matches to reduce the chance of accidental jumps. It work quite well in practice.

These types of navigation plugins are popular in the neovim/vim community. Other plugins with similar goals/ux include:

I imagined this working in vim mode but perhaps it could work in non-vim mode with a keybind.

stephen776 avatar Jul 19 '24 13:07 stephen776

I'm using flash.nvim quite actively and supporting something similar on Zed would be amazing.

  1. Search integration is great, it allows to jump anywhere on the screen very fast! image

  2. I found treesitter way to select objects very fast as well, with a key press you can select objects image

zebede22 avatar Sep 10 '24 08:09 zebede22

Howdy! πŸ˜„

I wanted to share some further "prior art" on this style of (n)vim navigation:

  • vim-easymotion https://github.com/easymotion/vim-easymotion
  • VSCodeVim configuration setting to emulate easymotion https://github.com/VSCodeVim/Vim?tab=readme-ov-file#vim-easymotion

Would love to see it in Zed ❀️ and thank you for this awesome editor πŸ™

aegatlin avatar Sep 26 '24 06:09 aegatlin

As awesome as zed already is, integrating something like this, even as an extension, would lift it to another level :) Hope it happens.

machin3io avatar Nov 04 '24 20:11 machin3io

Is this possible to add via an extension? Would prefer core ideally but I'd be happy to look into writing a plugin

djmango avatar Nov 11 '24 22:11 djmango

also wait this feature

Dev-cmyser avatar Nov 23 '24 17:11 Dev-cmyser

Is this possible to add via an extension? Would prefer core ideally but I'd be happy to look into writing a plugin

yeah, maybe try to do this ? I don't have ex in rust but i think you , me and chatgpt can create this

Dev-cmyser avatar Nov 23 '24 17:11 Dev-cmyser

for start - we can create 1 feature - "jump in all creen"

Dev-cmyser avatar Nov 23 '24 17:11 Dev-cmyser

As it seems, extensions don't support this kind of functionality

djmango avatar Nov 23 '24 19:11 djmango

As it seems, extensions don't support this kind of functionality

why ? i don't undeerstand

Dev-cmyser avatar Nov 24 '24 09:11 Dev-cmyser

Not sure but see the other related issues, they denied a PR for this functionality too


Sulaiman Khan Ghori ( https://skg.gg/ ) | X ( https://x.com/sulaimanghori )


On Sun, Nov 24 2024 at 1:27 AM, Kirill Novgorodtsev < @.*** > wrote:

As it seems, extensions don't support this kind of functionality

why ? i don't undeerstand

β€” Reply to this email directly, view it on GitHub ( https://github.com/zed-industries/zed/issues/14801#issuecomment-2495888848 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AGZNIXGHVRL3GR4JLBURVOL2CGLZZAVCNFSM6AAAAABLEJGF3CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJVHA4DQOBUHA ). You are receiving this because you commented. Message ID: <zed-industries/zed/issues/14801/2495888848 @ github. com>

djmango avatar Nov 25 '24 18:11 djmango

As far as I'm concerned it isn't possible for extensions to implement this -- at least we need to be able to read user input in some way (for the input of search pattern and follow-up label) and update text on the screen (this is somewhat doable via lsp capabilities but the implementation would be awkward). In the end we still need the devs to come up with other solutions -- either to provide more apis for the extensions (which may benefit other kinds of extensions as well, I personally would love some sort of fzf-lua equivalent) or a native implementation for this feature.

j4ger avatar Dec 22 '24 08:12 j4ger

+1, seems pretty useful.

nnra6864 avatar Mar 29 '25 11:03 nnra6864

I really want to switch to using Zed as my daily, but not having this functionality just makes me so much slower. Until then I'll stick to Rider

Marrieto avatar Apr 01 '25 07:04 Marrieto

Would love this!

NightSling avatar Apr 22 '25 16:04 NightSling

Any updates on supporting flash like movements? I was surprised coming from VSCode that something like flash isn’t either built-in or could be added by extension in Zed.

itpropro avatar May 14 '25 08:05 itpropro

I believe this is the only missing piece of the puzzle to finally get nvim users to switch to Zed as their primary daily driver.

claytonchew avatar May 26 '25 08:05 claytonchew

Same, this would be absolutely amazing, 137 thumbs up on the original post and counting!

joaqo avatar Jul 12 '25 15:07 joaqo

Big please πŸ™β€οΈ!

hsyed avatar Jul 16 '25 08:07 hsyed

Just pitching in - what's missing for this to make its way to zed? Can we help at all?

This is easily the biggest feature I miss from other editors. Let's make it happen.

ghalestrilo avatar Jul 30 '25 21:07 ghalestrilo

YES!

vitornesello avatar Aug 06 '25 14:08 vitornesello

are there any plans to support these features? would be really useful to improve navigation

0xrusowsky avatar Aug 28 '25 13:08 0xrusowsky

Doesnt helix also support this type of searching put of the box? Seems like it would also be needed to support the helix bindings.

kylejbrk avatar Sep 01 '25 05:09 kylejbrk

instead of spamming comments of "yes / +1" just react to the issue please! It's enough for the maintainers to understand that people want it

rawnly avatar Sep 01 '25 07:09 rawnly

Howdy! Commenting to add my voice to the rumble!

Really excited to see how much progress has been made on Zed's vim mode! flash.nvim is something I lean heavily on in nvim, and it would be nice to see this in Zed as well!

walker-tx avatar Sep 08 '25 12:09 walker-tx

vscode has the same feature through extension called "cvim". hope Zed can has this feature soon as many people lean on it.

didi0987 avatar Sep 17 '25 00:09 didi0987

This hinging on better extension support really highlights how much a better extension API is needed

margaretjoanmiller avatar Sep 23 '25 04:09 margaretjoanmiller

I would suggest leap instead of flash. It's:

  • more popular (4.9K start vs 3.5k)
  • it improves on vim-sneak (so you can cross vim-sneak off the list of alternative implementations, IMO)
  • more ergonomic (allows editing query, eg. backspace lets you adjust/fix queries, and is easy to trigger, with one key)
  • it's written in Fennel (LISP for Lua, might be harder to port, but technically AI should be able to parse it more easily)
  • it's the default for LazyVim (https://www.lazyvim.org/extras/editor/leap#leapnvim)
  • replaces s and S in vim mode, which aren't all that useful or used, so it wouldn't need to take any other key binds.

paul-manole avatar Sep 25 '25 11:09 paul-manole

@paul-manole

more ergonomic (allows editing query, eg. backspace lets you adjust/fix queries, and is easy to trigger, with one key)

I think flash also gives you the same feature. You can press backspace to edit your query. (Or, I may have misunderstood what you meant)

t's the default for LazyVim (https://www.lazyvim.org/extras/editor/leap#leapnvim)

No it's not, it is added as an "extra" plugin the default is flash.nvim (https://www.lazyvim.org/plugins/editor#flashnvim) flash is added in the core plugin list.

LogicKahanHai avatar Sep 26 '25 11:09 LogicKahanHai