Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPStorm navigate to file by name and path using fuzzy search

I am switching from Vim to PHPStorm. In Vim I had a plugin called CtrlP which could be used to search for files with its path using fuzzy logic.

For example, searching for the string "defaorderwid"

Would suggest the file "themes/default/views/order/widget.php"

(Sublime also has this functionality too ("Goto Anything"), available via Ctrl+P.)

How can I do something similar in PHPStorm? I am aware of Ctrl+Shift+N search, but it searches only names of files without paths.

It is important for me because in current project I have many files named "widget.php" in different folders.

like image 971
user2665732 Avatar asked Aug 12 '14 07:08

user2665732


People also ask

How do I search for a directory in PhpStorm?

From the main menu, select Edit | Find | Find in Files Ctrl+Shift+F . In the search field, type your search string. Alternatively, in the editor, highlight the string you want to find and press Ctrl+Shift+F . PhpStorm places the highlighted string into the search field.

How do I search globally in PhpStorm?

Search everywhereFrom the main menu, select Navigate | Search Everywhere or press Shift twice to open the search window. By default, PhpStorm displays the list of recent files.

How do I mark a line in PhpStorm?

Add a mnemonic line bookmarkIn the editor, place the caret at a line of code and press Ctrl+F11 . Alternatively, right-click the gutter next to the line of code that you want to bookmark and select Add Mnemonic Bookmark.


2 Answers

Press Shift, Shift (twice). Then enter widget.php and prepend the folder, or parts of it. Works for me.

They call it "Search Everywhere", or "Double-Shift" feature.

If you want to use abbreviations, you can CamelCase or or CamelHumps or SnakeCase your search, or use Wildcards (*). Read here.

like image 74
sina72 Avatar answered Nov 20 '22 03:11

sina72


if you have files like:

/buildings/users/create.blade.php
/rooms/users/create.blade.php
/parks/users/create.blade.php

you can search like that:

1. double press SHIFT
2. type: buil/creat (first letters of folder and file)
3. PHPStorm will find: buildings/users/create.blade.php
like image 21
Mantas D Avatar answered Nov 20 '22 04:11

Mantas D