I found "Select Word at Caret" in the Edit menu. Is there a way to do similar, but select the entire line?
If you have nothing selected, and press ⌘ + C, PhpStorm will automatically copy the line at the caret. So basically, you don't need the 'Select Line at Caret' action.
I found "Select Line at Caret" in Preferences under "Keymap". (And associated it with ⌘-L.)
If you are using phpstorm 9 you can press couple of times ctrl + w to select the current line. Also it has some other benefits. Check out Extending selection at https://www.jetbrains.com/phpstorm/help/selecting-text-in-the-editor.html for more details
Related
I want to be able to edit every line of my data simultaneously, for instance put quotations in front of every line. I am wondering what the key combination is that will enable me to do this.
Four steps:
Select all the text: CTRL A
Activate multi-cursors: CTRL (or CMD on Mac) SHIFT L
Press the Home key to move all cursors to the front of the line
Press the " quote key to insert the quote.
Using the Home End and CTRL + left | right arrow keys is handy when managing multiple cursors.
On a mac, you can highlight the lines you wish to edit and use CMDShiftL, or ctrlShiftL on Windows.
On Mac
cmd+A (Select all)
cmd+shift+L (Split selection into lines)
shift+2 (Surround selection with quotes)
esc (Escape)
On Windows
CTRL+A (Select all Data)
CTRL+Shift+L (Cursor will appear on each line)
Shift+ (right or left key) (move the cursor left or right)
Press ESC to remove the focus.
In case if you want to put cursor at every string as currently selected, use Find All shortcut:
Windows/Linux: Alt+F3
Mac: ⌃+⌘+G
All Multiple Selection shortcuts
I am finding I often will multi-select a bunch of single points (ctrl+click on the point) in Sublime Text 2, get to the end of the items I want to multi-select and then discover one in the middle of them all that should not have been selected.
I then have to cancel the multi-select (esc key) and start my selection all over.
Is there a way to deselect a single multi-select point? I looked all over the net and experimented with the traditional opposite items such as ctrl+shift+click on the point I want to deselect. No joy.
Thanks in advance for your help!
Try this one:
alt + Middle Mouse Button
this feature/shortcut is called subtract from selection.
In OSX ⌘+opt+shift+ left click removes an added multi-cursor.
On Linux, if you are using a touchpad, try using: Alt + Shift + Right-Click.
If you are on OSX, you need to disable drag_text.
Edit your user preferences, i.e. super + , and add this:
"drag_text": false
Otherwise, you can select just like before - ctrl + click (command + click), and to deselect an instance you use alt + click (command + shift + click).
To deselect any text region (this way also deselects any included cursor point(s)):
On Windows
Alt+Shift+Right_Mouse_Button (Drag-Select what you need to deselect)
OR: Alt+Middle_Mouse_Button (Drag-Select what you need to deselect)
On OSX
Command+Shift+Option+Left_Mouse_Button (Drag-Select what you need to deselect)
OR: Command+Shift+Middle_Mouse_Button (Drag-Select what you need to deselect)
This works on SublimeText 2/3.
In case you want to deselect a single cursor point (not a region), you can do the same and drag-select any region that includes that cursor point. [Example: My Wor[Cursor]d. To deselect the cursor you can drag-select on: r[Cursor]d (or any region including the cursor) and it will automatically deselect the cursor point.]
Source: Column Selection
Is there any plugin or shortcut to hide all except code section in sublime text 2?
I need to fold all except section at a time , Not fold one section at a time.
Thanks~
If you'll hover with the mouse over the line numbers you'll see arrows - clicking on any of them will fold/collapse the code
If you want to collapse/expand all - you can do so by going to edit->code folding and choose "fold all" or "unfold all":
In addition to the other answers it is also possible to fold based on level as well. So for example looking at the default key bindings for fold.
Searching for fold key bindings.
So for example a foldall, or folding level 1 would be to hold Ctrl followed by pressing the sequence k and then 1:
Or folding level 2 would be to hold Ctrl followed by pressing the sequence k and then 2:
Or unfolding all would be would be to hold Ctrl followed by pressing the sequence k and then 0 or in my defaults I also seem to have it bound to the letter j:
Warning.
Pressing Ctrl+k twice will remove a line or a count of lines.
But not really cause you can put them back one by one by Ctrl+u
One thing you can do is select the Except code bloc using a regular expression, for instance using except(.|\n)*?raise.* in your case. You can then select "Find all" in the search bar, then Edit->Code Folding -> Fold .
Windows shortcut : Ctrl-Shift-[
Mac shortcut: Cmd-Alt-[
All the Except bloc will then be collapsed.
I know this is an old question, but it still comes up high in search results and none of the answers quite do what the OP wanted.
select the code you don't want to be hidden
use "Selection" -> "Invert Selection" to select the code you do want to be hidden instead
use ctrl + shift + [ or Command + Option + ] to collapse the selection(s)
This will leave you with just the code you originally had selected visible.
Fold and UnFold function or class base only for MAC:
* Fold: command + K, command + 1
* UnFold: command + K, command + J
I am using Windows 8 OS
I have some projects where I repeatedly add the same tags to different types of elements, but the format of how the elements are presented through code always stays the same. I'm looking for shortcuts that will help me do these tasks quickly. Is there a shortcut that lets you add the same tag for multiple lines that you specify? I know you can do (CTR + F3) To select clone tags and change all of them, but I want to add tags to elements that previously had no tag. Is there a way you can make your own shortcuts for your tags, like if I type in "li" It will automatically put in "" and all I have to do is hit enter?
Here is an example of the elements and tags I added:
<ul>
<li type="square">Extra Grip
<li type="square">Made of Titanium
<li type="square">Built in Selsoft Processor
<li type="square">Portable</ul>
<b>MBS:</b> 44 kN (10000 lbf)<br>
<b>Weight:</b> 1 lbs 13.2 oz (828 g)<br>
<b>Length:</b> 14.40" (36.6 cm)<br>
<b>Width:</b> 3.75" (9.5 cm)<br>
<b>Height:</b> 1.00" (2.5 cm)<br>
<b>Material:</b> Titanium
Ctrl+C, Ctrl+X and Ctrl+V let you copy/cut/paste lines if you don't select anything. So, Ctrl+X doesn't "delete" a line, it cuts it. To delete a line, the default shortcut is Ctrl+Shift+K :)
Highlighting a bunch of lines then hitting Cmd (Ctrl?) +Shift+L gives you multi-cursors on each line. I do that, followed by Cmd + Right arrow (End?) to get easily get a cursor at the end of a series of lines to simultaneously type something after each.
Ctrl+Shift+J expands the selection to the indentation level of the current line. So if you want to select a block of code with the same indentation it's really useful.
Alt + F3 select all occurrences of current word for multiple editing. Very useful.
A few written about in more detail: http://whiletruecode.com/post/7-handy-text-manipulation-tricks-sublime-text-2
Have you tried to make your own snippets? It may not be exactly what you are asking for, but could be another way to do it.
Try the New Snippet command in the Tools-menu and add the following and save it:
<snippet>
<content><![CDATA[
<li type="square">${1:Item} ${2:}
]]></content>
<tabTrigger>li</tabTrigger>
</snippet>
This will enter an <li>-tag in the current file if you type li and then press Tab.
You can also add a <scope> tag to limit it to HTML-files.
I have a text file with 100's of news articles.
I need to Select All > Take cursor to the beginning of each line and have the 'multiple cursors' open so I can add some data.
Since the new articles do not have the same begging character, I can not use CTRL+F3.
Is there a way to [CTRL] + [A] (Select All) then > Go to the begging of each line with 'multiple cursors' open ?
You should select all with ctrl+A.
Then split the selection into one selection per line with ctrl+shift+L.
Then press the left arrow key.
Now you should be able to type data at the beginning of each line.
Let me add some answer, ( work in sublime 2 / sublime 3 )
i try with #Riccardo Marotti step
, but when the article have tab it will lead to the very far first line
So I make some fix , To make cursor in every front line or every end of line :
ctrl+A // select all
ctrl+Shift+L // Add cursor to all line
Shift+Home // put cursor to first word in the line
to get the end of line no need to do the first step again if you are in the first line, just do this one :
Shift+End // put cursor to end of line, then
click "right arrow" to remove the drag
or you can try this one (really an experimental works)
Just use you center of mouse, click it (the center roll of your
mouse), then drag, this will lead to add more cursor
, then just press left/right
or try to seek more here :
sublime-text-multiple-cursor-shortcut
override-shortcut-for-multiple-cursors
hope this help
I think ctrl+alt+down (or up) when your cursor is at the beginning of a line might be what you're looking for. It will put the cursor on multiple lines, and what you type will be duplicated on each.