How to make quick access to log file of a project? - phpstorm

If there is a way in PhpStorm 2021.1 to open some files from my project ?
I want quick access to /storage/logs/laravel.log file...
Thanks in advance!

Use Bookmarks. In particular: Bookmark with mnemonic. It works on lines as well as whole files.
https://www.jetbrains.com/help/phpstorm/bookmarks.html#add-mnemonic-line-bookmark
Select a file in the Project View panel
Hit the Edit | Bookmarks | Add Mnemonic Bookmark shortcut (Ctrl+F11 here on Windows)
Select the mnemonic (I suggest selecting numeric 0..9 for a fast keyboard navigation since they have default shortcuts already assigned).
That's it. Now you can press Ctrl + digit (Ctrl + 0 in this example) to quickly open that file.
NOTES:
If you delete the bookmarked file (pretty typical situation for the log files) then the bookmark will be automatically removed (maybe not straight away but on next project opening but still).
You can also use Edit | Bookmarks | Go to Mnemonics... (Ctrl+Shift+F11 is the default shortcut here on Windows) to navigate between multiple mnemonic bookmarks (if you use Letter mnemonic and do not have custom shortcut for that)
You can also use plain/ordinary bookmarks (not mnemonics): the only difference is that you will have to use Bookmarks toolwindow or Bookmarks popup (Edit | Bookmarks | Show Line Bookmarks... Shift + F11 here on Windows) to locate and navigate to them.
Shortcuts can be changed at the usual Settings/Preferences | Keymap screen:

Related

How to open all modified files in PhpStorm

The goal is simple - I want to open all modified files at once. Is there a fast way to do it?
Currently I am using Alt + 9 and then open files, but that is not fast enough (press shortcut, select all, press Enter, manually open files that are "unversioned")
You can create a macro for the keystrokes you mentioned, and assign a keyboard shortcut to it:
Edit | Macros | Start Macro Recording
Perform the keystrokes: ALT+9, CTRL+A, ENTER, ALT+9
Edit | Macros | Stop Macro Recording, give it a name
Settings | Keymap | Macros, add keyboard shortcut.

PhpStorm navigate to -> file search only for Twig files

I have strange problem connecting with PhpStorm IDE. I use version 2016.3.2 Build #PS-163.10504.2.
I love using Ctrl + Shift + N for searching files which I need to override. I have 2 project (one new, one old) and in old file searching works fine and in new search only for twig files and nothing else.
Is there any configuration I need to change?
Check filter -- the blue Funnel icon on the right top corner of that popup -- you may have selected to list files of certain types only.
Otherwise -- try universal File | Invalidate Caches... and restart IDE -- it usually helps in such "suddenly stop working" situations.

PhpStorm multiple project navigation, quick switch between projects

How can I open few projects in left work area in PhpStorm? I need to quick switch between projects.
If you want to open more than one project in this way (and by this I mean so they have their own different settings), then currently it is not possible.
http://youtrack.jetbrains.com/issue/WI-15187 -- vote/star/comment to get notified on progress.
If you need to include files from those projects for reference purposes (to see how you have done it there, to copy some code from there etc) -- you can include them under "External Libraries" -- Settings | PHP | Include paths. Files included this way are protected from modifications.
If you need to modify those files ... you can add them into actual project as Additional Content Root (Settings | Directories| Add Content Root) -- such folders will be treated as part of the actual project with no separate settings.
Other than that -- Alt + Tab (or whatever the shortcut is on your OS) to switch between different PhpStorm windows (each project is opened in separate window/frame).
This is a right on time answer.
It is possible to quick switch between project by adding a keyboard shortcut to the "manage project" menu.
To do just that, go to Settings > Keymap and search for "Manage Projects". Then add it the keyboard shortcut you desire and you're all set.
Hope this will help someone looking for an answer like I did.
As LazyOne said, you can add paths to your project from Setting | PHP | Include paths or from the useful keystroke F4.
But I'd like to also share how I organise my projects, I think when you create a project, you should not open a new window but instead open it in the same window.
This way you don't get confused between the different opened windows.
In settings you can assign a keystroke to Reopen recent projects. I then use ctrl + shift + R but it is up for you to chose the keystroke you like.
Hope this will help you as I struggled as well to find a way to manage all my current projects.

Navigate back and forth between recently opened files

Is there a keyboard shortcut in Sublime to navigate back and forth between recently opened files? Something like Alt+Right and Alt+Left (an example from Eclipse or web browsers). If not, is there a way to create a custom shortcut like this?
You can use the following shortcuts to navigate through different open files:
CTRL+PAGE UP Cycle up through tabs in taborder
CTRL+PAGE DOWN Cycle down through tabs in taborder
CTRL+TAB Next recently used file
CTRL+SHIFT+TAB previous recently used file
More Shortcuts for sublime can be found here.
Custom shortcuts
Go to Preferences > Key Bindings-Default and find the binding that you need and copy the command. The next step is to open references > Key Bindings-User where you paste and edit the command.
More concrete info about custom shortcuts can be found here.
It is possible if you still have them opened. Other than that
That's CTRL+TAB / CTRL+SHIFT+TAB.
Other than that, if you need to have possibility to open recently closed files, you may try doing it with CTRL+SHIFT+T (open last closed tab), try this package out or even visit this thread and see if it still works.
If you have a large number of files open, you can use ctrl + P, and use GoToAnything.
Unofficial doc information

Make PhpStorm show changed/modified files in project view

After moving from Zend Studio (ZS) to PhpStorm, I am starting to miss the way that ZS used to show changed files and display more than one project at once.
For example, notice how it shows that IndexController.php has been modified.
Is there any way to do this with PhpStorm?
Starting from PhpStorm 2022.1:
To highlight folders containing vcs changed files enable:
File | Settings | Version Control | Confirmation | Highlight directories that contain modified files in the Project tree
Older versions:
As mentioned in comment by LazyOne;
The Project panel does highlight any VCS changes,
but to also highlight all parent-folders of changed-files, enable:
File | Settings | Version Control | Show directories with changed descendants
All kudos to LazyOne!
Pressing Alt + 9 (not from numpad) you can get a panel with the changed files.
Go to file >> settings >> Editor >> General >> Editor Tabs.
Check Mark modified tabs with asterisk
Click ok
For PhpStorm version 2022.1.2, on MacOS Big Sur, you will need to go to:
Preferences -> Version Control -> Confirmation, then under Changes you will need to check the "Highlight directories that contain modified files in the Project tree" box.
Another alternative: ctrl + shift + e
To be more specifically. Under File Status (settings)
[option] Have changed descendants
[option] Have immediate changed children
[option] Modified
Change this three color
Another alternative : ctrl + e
PhpStorm store all the changes on your file. If you use Git or VCS it is easy to see what changes you have, but this is also availabe for normal local projects.
Open:
VCS -> Local History -> Show History
You will see the big windows divided on 2. Left showing all the versions, right all the modified files. Double click also gives you a diff windows, showing diference between both files.
All The modificationas are shown as a scalar one, means that selecting left the top one will show just last modification. Selecting in left the scond will show agregated modification since this time.
Let me know if you need more explanation.
As in PhpStorm 2021 you can achieve it by going to Settings > Version Control > Git and check Enable Staging Area
In a Git toolbar (ctrl+9) tab named Local changes
If someone is still looking for solution:
Go to View & look for Changes option, it should bring up the tree view of changes for current project.
You can also do show diff with current working tree in VSC pane.