Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select all occurrences of string find and replace with new string #6070

Closed
1 task done
krstp opened this issue Mar 29, 2023 · 13 comments
Closed
1 task done

Select all occurrences of string find and replace with new string #6070

krstp opened this issue Mar 29, 2023 · 13 comments
Labels
editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label]

Comments

@krstp
Copy link

krstp commented Mar 29, 2023

Check for existing issues

  • Completed

Describe the feature

Ability to select ALL OCCURRENCES of a given string and replace all with a new string.

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

custom_syntax_highlighting

No response

@krstp krstp added enhancement [core label] triage Maintainer needs to classify the issue labels Mar 29, 2023
@JosephTLyons
Copy link
Collaborator

Hey @krstp, just curious, are you looking for more of a traditional replace, as in Find and Replace, or are you looking for a command similar to editor: select next, that adds in multiple cursors, but for all occurrences in the current buffer?

@JosephTLyons JosephTLyons added editor Feedback for code editing, formatting, editor iterations, etc needs info / awaiting response Issue that needs more information from the user and removed triage Maintainer needs to classify the issue labels Mar 30, 2023
@krstp
Copy link
Author

krstp commented Mar 30, 2023

Rather select ALL instances (at the same time) such as <string> and as it selects I can type and replace the string. Currently there is F2 "Rename symbol", but it does not apply to custom string selection. I hope this clarifies, let me know.

@JosephTLyons JosephTLyons removed the needs info / awaiting response Issue that needs more information from the user label Mar 31, 2023
@krstp krstp mentioned this issue Apr 1, 2023
1 task
@jafoobari
Copy link

I would also love a Find and Replace feature. Just ran into a use case where I was sorely missing it while editing a Markdown file. Something like the F2 Rename Symbol feature would be fine with me if it worked for any string. Traditional Find and Replace is fine by me too, but I'm not picky since this is infrequent but painful when needed and lacking.

@krstp
Copy link
Author

krstp commented Apr 5, 2023

Either way seems similar to #5448 ; just here we ask for replace. Either way, similar functionality in its core, but as of now not working and hence different. Leaving it open.

@HananoshikaYomaru
Copy link

this feature is a must for a text editor!!

@krstp
Copy link
Author

krstp commented Apr 26, 2023

A somewhat workaround and maybe something that could be leveraged to a bigger scale is to use F2 at the moment. It will work for a lot of definitions such as any kind of object, even int etc., but whenever there is a Docstring or just a String to replace, the F2 will not recognize it, so... yes one can use for now F2, but its usage will be limited. Yeah, I am really longing for all-around find-replace.

@krstp
Copy link
Author

krstp commented Apr 26, 2023

Another workaround I have just notice is pointed out here: #5448 . Hold CMD+D so it selects all instances. After all of them are selected (at times it can take some time) one can type to replace.

Note: The only indicator if all the instances are selected would be the count of characters in bottom-right corner... so if String is 10 chars, and there are 6 instances across the file, it will point and stop CMD+D selection at 60 count. I hope it helps anyone.

@tobinibot
Copy link

My two cents, aside from any actual refactoring (like “rename variable/method”), I was hoping to find the classic "Find and Replace”. I can’t really use Zed as a replacement until is has this. Additionally, it’s almost a requirement (for me) to have regex support in both the find and replace fields as well, I find myself using it constantly in other apps.

@iamvoidcoder
Copy link

+1 for this (and +1 for classic Find and Replace too)

@hoomp3
Copy link

hoomp3 commented Jul 30, 2023

another +1 for both of the above

@krstp
Copy link
Author

krstp commented Jul 31, 2023

I think we already started somewhat having this in latest releases, or maybe only in preview. When you search for a string, then use option+enter it will select all instances. Thank you ZED team for implementing!

@anvox
Copy link

anvox commented Aug 3, 2023

+1 for (Search and) replace. But trying with option+enter, seems it's more fun than the old way 🤩

@osiewicz
Copy link
Contributor

osiewicz commented Oct 5, 2023

Hey, closing this issue as we already have search & replace in both project and buffers. Feel free to reopen if anything!
/cc @JosephTLyons

@osiewicz osiewicz closed this as completed Oct 5, 2023
@JosephTLyons JosephTLyons transferred this issue from zed-industries/community Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label]
Projects
None yet
Development

No branches or pull requests

9 participants