Is there a Shortcut for "Find in Path with Current File Scope"?
I mostly use Find in Path window feature in IntelliJ IDEA.
There's one major annoyance when I want to Search String in Current File (Ctrl + F), the current cursor will move to search result.
and this messes my workflow.
I just wish I can only see the searched result preview and close the preview, and go back to the current cursor.
This is actually possible with Find in Path window, for this, I need to press Ctrl + Shift + F and go to the Scope tab, and select Current File (since default Find in Path's option is for whole files in the project).
These are too many steps to use a function that I need.
Is there any way or shortcut to quickly approach the function that I need?
Or should I request a new feature for it?
Thanks.
Please sign in to leave a comment.
> the current cursor will move to search result.
You can press esc to close Find popup, or use Alt+F7 shortcut to see results in the find tool window, so you can simultaneously check the results and look at the file.
I would also appreciate a shortcut for this.
The suggested Alt+F7 after opening the find popup is close, but it still moves the cursor to the search result when opening the find popup, and it's two shortcuts instead of one (more than two shortcuts if I need to iterate on my search).
Also pressing esc to close the find popup doesn't move the cursor back to where it was, at least in Rider 2024.2.5
Hello, Sieppertcalum.
Unfortunately, I can't reproduce it on my side; the caret stays where it was when I closed the Find window. Is it possible for you to capture a short video displaying the problem and share it with me? You can use our JetBrains Uploads service for this purpose and write me the ID you receive there.
Hi Olga Mulina , thanks for taking a look.
I might have been unclear with a couple things:
I recorded a demonstration here (it's not showing but I was hitting escape to close the find popup):
Upload id: 2024_09_30_QUag3gmLJcf6BHuFkbGMLE (file: jetbrains-find-issue.mp4)
I think a good solution is what Wonsuc was suggesting, have a single key to open the `ctrl+shift+f` find window with the “scope” set to the current file (but `ctrl+shift+f` shouldn't have its scope changed to the current file the next time I use it, ideally it would still remember the scope I used with it the last time)
Sorry, your suggestion is not clear to me; now the scope is remembered for the Find in Files feature: after you search for something in the Current File, the next time you open Find in Files popup, the selected scope is the same.
Olga Mulina Hello. My original request was to ask if IntelliJ could provide a shortcut for the Find in Path window to default to the search option for the Current File. Apart from this shortcut, when Ctrl + Shift + F is pressed, the search should be performed based on the default option and not the current file. This is because in development, in certain situations I want to search the entire source code via Ctrl + Shift + F, and in other situations I need to launch a Find in Path window that only runs within the current file via Ctrl + Shift + (some key), and the two can be crossed repeatedly.
^ Yes this is what I meant, two different shortcuts, sorry if that wasn't clear.
Thank you for the update. Created a separate feature request for you: IJPL-163372. Please consider upvoting it to receive updates and show your interest in the feature.
Olga Mulina Thank you for your support!