Navigate to specific tab in PhpStorm (CMD-1 / SUPER-1) - phpstorm

In Google Chrome and Atom (and probably also in other programs), it's possible to 'Go to tab # 1' by pressing CMD + 1 (for Mac) or SUPER + 1 (for Windows). I love that feature more than I love my mother, - but I can't find anyone else requesting a way to set it up in PhpStorm (for some reason).
I know that I can navigate to other tabs using the Switcher or pressing CMD + [ or CMD + SHIFT + [. I have read all of this page: https://www.jetbrains.com/help/phpstorm/2017.1/navigating-between-editor-tabs.html - without any luck.
I've also gone through the Keymap in the settings, looking for a way to set it up - but I can't find a way. In the Keymap - there is no actions called: 'Go to tab # 1' nor 'Go to tab # $var'.

There is no such built-in functionality available.
https://youtrack.jetbrains.com/issue/IDEA-68324 -- follow this ticket (star/vote/comment) to get notified on any progress.
But you may use GoToTabs plugin for such browser-like tab navigation.

Related

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

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:

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.

How to set default scope to Directory in 'Find in Path' dialog

I'm pretty sure that on other computer when I've used 'Find in Path' or pressed Ctrl+Shift+F when I've previously selected directory, radio button 'Directory' in 'Scope' was checked by default. Now I must press Ctrl+Shift+F and press Alt+O additionally for searching in selected directory. Maybe that's some bug?
How to set my Find in Path dialog so it will be saving last search options? I see that it's saving options listed in 'Options' area in 'Find in Path' dialog. Scope is changing to 'Whole project' all the time.
I can't find that option in PhpStorm. I can't find similar problems/explanation of problem in google.
Maybe that's some bug?
No bug here -- works as designed.
I can't find that option in PHPStorm, I can't find similar problems/explanation of problem in google.
There is no such (global) setting.
Some of the options on that dialog window will be set accordingly to the context (where it was invoked from):
if invoked from Editor (focus was in Editor when you pressed Ctrl + Shift + F) then it will be "Whole Project". In most cases that's exactly what will be needed.
if invoked while having focus in Project View panel .. then it will select that particular directory as default scope/path.
You can follow this ticket for any progress on this matter: https://youtrack.jetbrains.com/issue/IDEA-87037
I realized, that if there is index update running, that's behaving in such way. When indexing is finished, everything works as I'm expecting (so, PHPStorm is searching in selected directory). I think it looks weird.

Split selection into lines in PHPStorm

In Sublime I was quite fond of the "Split selection into lines" shortcut (super+shift+l). However I cannot find an equivalent of that in PHP Storm 8, I've found a "Split into lines" function in the Edit menu but feeding it either \n or \r doesn't seem to work. Does that function exist in PS ?
By default on PHPStorm 10+, you can toggle the Column Selection Mode with:
CMD + SHIFT + 8
Of course, you can configure any stroke you like. I like to keep the original one and add the one that matches Sublime which is CMD + SHIFT + L. Here is how:
Another option would be to use column selection mode:
https://stackoverflow.com/a/30031481/672989
There is a "Split Selection into Lines" action in the Extra Actions plugin.
Compatible with: Compatible with: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion GoLand DataGrip Rider MPS Android Studio
If I have a 200 line selection I don't want to have to create a cursor at the end of every line.
You do not have to "create a cursor at the end of every line" -- just create cursor on the beginning of each line (on Windows it would be Alt+Mouse drag Down/Up) and then just press End button. This is not that straightforward as separate dedicated action .. but still does the same job and pretty easy to execute.
In any case: there is no such exact action currently available in PhpStorm, unfortunately.
Please follow this ticket (star/vote/comment) to get notified on progress: http://youtrack.jetbrains.com/issue/IDEA-122181

How to start Sublime Text with selected project using a local .sublime-project file?

I may be missing the obvious, but can't seem to solve this fairly simple & typical case (with v3 build 3022 on Debian or XP, in case it matters):
Start Sublime Text opening a project "myprj", specified on its command-line,
using default.sublime-project located under that project's dir (say "/repo/myprj"),
automatically re-opening the last open files of that project (i.e. its workspace),
using default.sublime-workspace for that (also from the same project dir)
but (obviously) not auto-opening any other files remembered from non-project sessions,
and automatically saving all open files (to the above default.sublime-workspace) on exit.
Ideally:
$ sublime_text --project /repo/myprj/default.sublime-project
should just work. But it doesn't (see below).
Another approximation that seemed reasonable:
setting "hot_exit" and "remember_open_files" to false, and then invoking ST with:
$ sublime_text --data /repo/myprj --project default.sublime-project
But ST3 either doesn't find the project file (via --data), unless I chdir there first (--data seems to be no longer supported?), and it either doesn't auto-open any workspace files from last time (despite a previous "Project / Save Workspace As..."), or, if I set "remember_open_files" back to true, it just re-opens the last open files regardless of the project given on the command line.
I guess the issue is the workspace file not being handled automatically for some reason, and I'm just missing some trivial step somewhere. (The official docs (and also the unofficial) seem to discuss command-line switches for OS X only, and asking for --help didn't actually help with this one.)
(Please note: I wouldn't like to launch ST first, and then switch to some project from inside manually, and I also don't want to store the sublime-project/-workspace files outside of the prj. dir.) Thanks a lot!
I seached for a solution for a similar problem these days and didn't find a proper way. So i created an automator app with a small apple script. Maybe this helps you too.
Open Automator and Choose news Application.
Create an action to start Sublime Text 2
Insert an action to perfom the following apple script:
delay 0.2
tell application "System Events"
tell process "Sublime Text 2"
tell menu bar 1
tell menu bar item "Project"
tell menu "Project"
tell menu item "Recent Projects"
tell menu "Recent Projects"
click menu item "~/yourproject.sublime-project"
keystroke "p" using {command down, shift down}
end tell
end tell
end tell
end tell
end tell
end tell
end tell
For anyone still looking to do this, you can launch the built-in command line tool and launch it with a project like so (Mac OSX):
"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" --project "absolute-path-to-your.sublime-project"