To select multiple regions using the keyboard, select a block of text, then press Ctrl+Shift+L to split it into one selection per line. When you're done with using multiple selections, just press Ctrl+K to trim all but the first.
To quickly duplicate a line of code, place the cursor anywhere in the line and hit Cmd–Shift–D(Mac) or Ctrl–Shift–D (Windows).
Here is how to tell to Sublime text to do that automatically This is the result you want : [a space], the bracket, “$0” is where your cursor will be, then, the closing bracket. After that, on line 16, we manage the suppression of the open-bracket, to remove the close-one.
Yeah Regex is cool, but there are other alternative.
This allows you to edit multiple lines at once. Now you can add *Quotes (") or anything * at start and end of each lines.
Here's the workflow I use all the time, using the keyboard only
Note that this doesn't work if there are blank lines in the selection.
Note, disable wordwrap, otherwise it will not work properly if your lines are longer than sublime's width.
Let's say you have these lines of code:
test line one
test line two
test line three
test line four
Using Search and Replace Ctrl+H with Regex let's find this: ^
and replace it with "
, we'll have this:
"test line one
"test line two
"test line three
"test line four
Now let's search this: $
and replace it with "
, now we'll have this:
"test line one"
"test line two"
"test line three"
"test line four"
You can use the Search & Replace feature with this regex ^([\w\d\_\.\s\-]*)$
to find text and the replaced text is "$1"
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With