Search code examples
phpstorm

How in PhpStorm in “Find in path” dialog to select search in the directory of the active file?


If there is a way in PhpStorm 2019.2.3 opening “Find in path” dialog to select search in the directory of the active file ?

MODIFIED : When I start new session in my PHPStorm and having active file in one of subdirectories : https://i.sstatic.net/JMjXa.jpg I open “Find in path” dialog and see : https://i.sstatic.net/GcQ3L.jpg “In project” tab is active and in found files I see files found from all the project.

I open “Directory” tab and see error : https://i.sstatic.net/cV3dX.jpg Are there some options To Search In the current directory? Is something wrong in config of my PhpStorm 2019.2.3 ? Thanks!


Solution

  • To search in the directory of the current file, you need to take 3 steps:

    1. Open the Project Navigation bar
    2. Click the select opened file button on the project toolbar or press ALT+F1 followed by 1 (At least that's what the combination is on the Sublime Text Keymap)
    3. Press Ctrl+Shift+S or go to Edit -> Find -> Find in Path (or select the parent folder of your file in the project toolbar and right click to select find in path)

    Alternatively you can right click the file tab and copy the path to enter it in the directory option of find in files.