Multiple cursors in PhpStorm like Sublime Text 3? - phpstorm

You can use Alt + Click to set multiple cursors in PhpStorm but if you want to quickly make an array of some list like this, it's simply too many lines to click: (example from Sublime Text 3)
In Sublime Text 3 you simply select all the lines and hit Ctrl + Shift + L and it will set cursors at the end of each line and then you can hit Home button to set the cursors at the beginning or whatever.
I can't find anything in docs... maybe someone knows how to do this in PHPStorm or at least how to make some keyboard shortcut with macro or something?

Such action is available from 2020.2 version -- see IDEA-122181.
It's called Add Caret Per Selected Line and by default has Alt + Shift + G shortcut on Windows (⌥⇧G on Mac).
There is also Extra Actions plugin: it claims to do that and a few other things.
Current alternatives (that are much easier than the mentioned Alt + Click):
Just go into Column Selection Mode (from the "Edit" menu, Alt + Shift + Insert on Windows, Cmd + Shift + 8 on Mac). Exit that mode when done.
Alternatively, to add multiple carets (Clone Caret Below / Above):
On Windows: Press Ctrl twice, and then without releasing it, press the Up or Down arrow keys.
On Mac: Press Ctrl + Shift + Down / Ctrl + Shift + Up
You can also make a multiple selection by pressing Shift + Alt and dragging the caret.
From https://www.jetbrains.com/help/phpstorm/working-with-source-code.html#multiple_cursor

Related

How to use shift+alt+arrow-down for copy the selected lines just under the selected lines in Visual Studio Code

Previously I used Windows 10 operating system. I am a beginner and I am learning HTML, CSS. I used Visual Studio Code on Windows 10. There I used the shift + alt + arrow-down key to duplicate some selected lines just under the selected lines. I recently shifted to Ubuntu and the shift + alt + arrow-down key is not working like windows. It is not duplicating the selected lines.
How can I make these keys working like windows or is there any other key to do the same work?
Help me, please.
For Linux:
Ctrl+Shift+Alt+Down and Ctrl+Shift+Alt+Up
You Might need to use numpad Down and Up for Linux
You can also go to: File > Preferences > Keyboard Shortcuts. and search for: Copy Line Down or Copy Line Up, change the keyboard shortcut for this command by right clicking on the command and selecting Change Keybinding

Keyboard shortcut for changing windows in Octave

Is there any way to change from, for example, editor to command windows, or current folder etc in Octave? In Matlab, this can be done through the "Next tool", that is "Go to the next workflow step", which I normally set to be "Ctrl+Tab". This means, I just need to repeatedly hit the Ctrl+Tab buttons until I get to the window that I want.
You can see all available shortcuts or set your own from the preferences (Edit -> Preferences -> Shortcuts).
There is no 'rotating' shortcut, but you can set shortcuts to go to the particular window you want directly. The default shortcuts are:
Ctrl + 0 : Command Window
Ctrl + 1 : Command History
Ctrl + 2 : File Browser
Ctrl + 3 : Workspace
Ctrl + 4 : Editor
Ctrl + 5 : Documentation
Ctrl + 6 : Variable Editor
Similarly, adding shift to the above toggles their visibility on or off.
More importantly, if the reason you need tabbing is because you keep having to switch from the console to the editor, note that you can actually drag the editor from its titlebar and place it separately alongside the editor so that the two appear side-by-side.

Collapse all expanded sidebar folders in Sublime Text 2

Is there a menu option or keyboard shortcut to collapse all expanded folders in the sidebar? It gets messy over there and seems like there should be a better way than closing them one by one.
On OSX: option + left click at the root node.
On windows/linux: control + alt + left click
For Sublime Text 3 on Linux Mint 17.2 w/ Cinnamon I had to disable the following setting:
System Settings->Windows->Behavior->Moving and Resizing Windows->Special key to move and resize windows
After that Alt+left click worked!
Keyboard only
To collapse all expanded folders in the sidebar on macOS:
ctrl + 0: Focus the sidebar
home or cmd + up: Select first root folder
ctrl + left: Collapse all sub-folders (confusingly, not alt as per the equivalent mouse action).
(optional) right: Expand just the top level folder.
Thanks to the existing responses that provided this info.
I've not tested on other platforms, please update the answer if you can.
In Sublime Text 4, pressing "option/alt" on your keyboard and clicking a folder in Sublime's sidebar with your mouse, will collapse all sub-folders within the folder you clicked. I'm using a Mac. I'm not sure what happens on other operating systems.
using purely keyboard, on a mac, to unfold
CMD + K + 0
to fold, depending on the level of indentation
CMD + K + {level of indentation number} (eg. CMD + K + 2)
Refer here for more details functions of sublime text. Found this really helpful

PHPStorm: Keyboard shortcut to initialize multiple cursors on selected lines?

I used Shift + Command (Ctrl) + L in Sublime Text 2.
What is the equivalent shortcut to initialize multiple cursors on selected lines in PHPStorm 8?
You can add it yourself.
Go to Preferences -> Keymap
Search for Clone Caret Below and Clone Carrot Above
Bind a shortcut (I used Ctrl + Command + ↓ for the first one)
Hit it until all the lines you want to edit have cursors :)
You can achieve this in PHPStorm by Alt + Click
As I understand this particular functionality is not yet implemented.
https://youtrack.jetbrains.com/issue/IDEA-122181 -- star/vote/comment to get notified on ptrogress.
This is now available via the Extra Actions plugin.
Credit
GitHub
To enable, edit your keymap:
Recommended shortcut: Ctrl+Shift+L

How to format source code in phpDesigner 7.x

I am using phpDesigner and dont know how to format the source code in this IDE. Similar to right click and choose format in Netbeans (or Ctrl + Shift + F)
Does anyone know?
Thanks
Ok, I did it
For people who gets same problem: there are 2 ways
1. Press combination: Ctrl + Shift + F1
2. On the menu bar, select 'PHP' menu. Then select 'Code Beutifier for PHP' (the bottom option). Do the same with CSS and HTML
there is beautifier for JavaScript too, it is online http://jsbeautifier.org/
in PhpDesigner no such option.
javascript beautifier