Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Defining default scope for 'Find in Path' (PyCharm)

Tags:

pycharm

I'm using PyCharm Community Edition 4.0.4 and I'd like to set a default option for the scope of 'Find in Path'.

Currently, pressing Ctrl-Shift-F (the 'Find in Path' command) pops a window with 'All projects' selected, and I'd like to have 'Directory' with a custom directory set as the default instead. Here's a picture:

enter image description here

I searched the Settings for anything like this, but could not find it. Any help is appreciated.

Update: I've recently discovered that by right-clicking on my project folder and selecting "Find in Path ..." (I mean actually clicking the option), the scope is automatically set for the project directory! Strangely enough, the keyboard shortcut indicated in the drop-down menu from right-clicking the project folder is exactly the same as I use. Using the shortcut, however, yields the 'All projects' selection for Scope...

In any case, I still wish to set a default directory for the Find in Path dialog - preferably one that is consistently used regardless of how the dialog was invoked (shortcut, clicking drop-down option).

like image 227
vmg Avatar asked Sep 23 '15 16:09

vmg


People also ask

How do I find the path of a file in PyCharm?

Invoke Find in Path ( Shift+Ctrl+F Win/Lin, Shift+Cmd+F on macOS) to bring up the Find in Path dialog.

How do I change the path of a project in PyCharm?

Open the Project Structure settings. In the Projects pane of the Project Structure page, click the project you want to configure content roots for. In the dialog that opens, locate the desired directory and click OK.

What is a scope in PyCharm?

A scope is a set of files to which various operations apply. Using this dialog, you can define scopes for the various PyCharm actions, for example, Find Usages or Code Inspections.


1 Answers

It seems this is the default behavior for the Intellij-like IDEs such as Pycharm.

As answered by the JetBrains support:

"We have related issue in YouTrack: https://youtrack.jetbrains.com/issue/IDEA-87037 Feel free to vote for it and leave comments."

I reproduce the text of the issue below, in case the link goes dead:

IDEA-87037 Usability: Find in Path -- NOT in Whole project

What steps will reproduce the problem? 1. Press Shift-Ctrl-F

What is the expected result? The dialog comes up with the previously selected Scope.

What happens instead? The dialog always comes up with "Whole project" selected.

After having selected "Directory" for the 257th time (and forgetting it one out of four times) I can't help thinking that this is really stupid and obnoxious software.

I want to search in the entire project maybe once out of 100 times. Why does PhpStorm keep insisting that I should search in the whole project?

like image 83
vmg Avatar answered Oct 04 '22 19:10

vmg