I have been a user of sublime text, but now brackets has a lot of new features. The one that I cannot seem to be able to find is the multiple selection that you get from ctrl+D or cmd+D (mac)
Ctrl+D in SublimeText is "Quick Add Next."
This appears to be equivalent to Ctrl+B in Brackets, which is "Add next match to Selection" on the Find menu.
This works: Alt+F3.
Ctrl+B in Bracket is not the same as Ctrl+B in Sublime text.
This might be useful, a set of key map overrides for Sublime users in Brackets, navigate to Debug -> Open User key Map and enter these (Windows users afaik):
"overrides": {
"Ctrl-Shift-L": "edit.splitSelIntoLines",
"Ctrl-Alt-Up": "edit.addCursorToPrevLine",
"Ctrl-Alt-Down": "edit.addCursorToNextLine",
"Ctrl-Shift-D": "edit.duplicate",
"Ctrl-Shift-K": "edit.deletelines",
"Ctrl-D": "cmd.addNextMatch",
"Alt-Shift-1": "cmd.splitViewNone",
"Alt-Shift-2": "cmd.splitViewVertical",
"Alt-Shift-8": "cmd.splitViewHorizontal",
"Ctrl-R": "navigate.gotoDefinition",
"Ctrl-P": "navigate.quickOpen"
}
Or just use the Ctrl-D one if that's all that you need!
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 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
I want to find and replace a particular word in all my project files except one or more files in sublime text. I am not sure how to specify that.
SO basically I want to exclude
/Uses/project_name/css/my_file.css
/Uses/project_name/css/my_file2.css
Menu: Find-> Find in Files...
Sublime is gonna open a new panel at the bottom, you just need to fill the fields.
Find: the_word_you_are_looking_for
Where: your_project_directory
Replace: the_word_that_is_going_to_replace_the_old_one
Then click on the button ... located on the right side of the field Where:, and after click in the option Add Exclude Filter; replace the -*.txt with my_file?.css or my_file*.css
$_POST['daily_limit'];
$whatever = $_POST['smoke'];
$_POST['soup'] + $_POST['cake'];
to
$this->input->post('daily_limit');
$whatever = $this->input->post('smoke');
$this->input->post('soup') + $this->input->post('cake');
In this example, is there any faster way to switch from $_POST[] to $this->input->post() without writing up a regular expression find and replace? I don't care if it takes multiple steps. Writing the regex for this (find: \$_POST\[(.*?)\] replace: \$this->input->post\($1\)) takes longer than changing them all manually (maybe I'm just not good at regex). Any ideas?
I'm making a brash assumption here, that you have only one variable within each pair of brackets and that the variables only contain alphanumeric characters. ['soup'+'bacon'] will break this trick, as will ['soup-with-bacon'].
With your cursor, highlight an instance of $_POST[ - nothing else.
Hit Alt+F3 if you're on Windows/Linux (Cmd+ShiftG in Mac?)
Try to scroll through and see if everything that's selected is everything you want to replace.
Type $this->input->post( - nothing else.
Press → to move all cursors to the right of the first quote.
Press Ctrl+→ (this is the only remotely wtfh4xxy part of the process, and only if you're not used to navigating by word with the cursor) to navigate over the variable.
Press → twice to move all cursors to the right of the next quote.
Replace the ]with a ).
#nnnn I did a variation of your version to remove the wtfh4xxy part.
select:$_POST
altf3
type: $this->input->post(
ctrlshiftm
ctrlx
ctrlshiftm
ctrlv
type: )
Sublime text ftw!
I need the TAB to switch between highlights in my css snippets.
I'm using css snippets and #FFF+tab =>
I want to change zen-coding key biding from tab to CTRL+, (comma)
I've changed (the last line in default.sublime-keymap) from "tab" to "ctrl+,"
The new command works (ctrl+,) but I still have the tab transforming #FFF to a div.
HOW to completely remove the tab from zen-coding without affecting the TAB from Sublime?
Thanks
(I don't know what I've did wrong the first time but now it works)
so do change the key biding to zen-coding in sublime text 2 just change the last line in Preference > ZenCoding > Bidings > default.sublime-keymap
from
"keys": ["tab"]
to
"keys": ["ctrl+,"]
(or whatever new key you want)