Swiss Army knife for text manipulation and selection. This extension provides 65+ commands to manipulate and select text in your files. The commands are available globally and ready to be used any time with any file. If you have text selected it will perform the actions in the current selections otherwise it will perform the action in the entire file.
test string
becomes testString
test string
becomes TEST_STRING
test string
becomes test.string
test string
becomes Test-String
testString
becomes test string
testString
becomes teststring
Test string
becomes test_string
Test string
becomes Test_String
Test string
becomes test_String
Test string
becomes test-string
Test string
becomes TEST-STRING
test string
becomes TestString
test string
becomes test/string
testString
becomes Test string
Test string
becomes tEsT StRiNG
Test string
becomes Test String
Test string
becomes test string
Test string
becomes TEST STRING
step-by-step instructions
becomes Step-by-Step Instructions
a, b, b, c
becomes a, c
)%20
%20
to spacesDecode HTML Entities
"I don't know you"
becomes “I don’t know you”
“don’t know what you mean by ‘glory’”
becomes "don't know what you mean by 'glory'"
control+option+right
)control+option+left
)To learn more please checkout the examples below.
<li>$1</li>
, read more below.)
Easy, there are several ways.
Select All Ocurrences
This is an advanced way to filter by entering a simple query or a regular expression, this works for command that includes in it's name Matching...
for example: Delete Lines Matching..., Filter Lines Matching..., Select Lines Matching, etc.
Here are some examples of how to use it.
Having the following text, if we for example call the command "Filter Lines Matching..." and we enter gmail
it will leave only the lines that contains gmail
marquardt.gudrun@gmail.com
okuneva.gerhard@yahoo.com
miracle47@olson.org
uruecker@kemmer.com
lulu.gerhold@yahoo.com
xfranecki@gmail.com
result will be:
marquardt.gudrun@gmail.com
xfranecki@gmail.com
To match lines at the beggining, when calling the command (for example "Filter Lines Matching...") we just need to enter our query starting with a ^
so if we enter ^ma
marquardt.gudrun@gmail.com
okuneva.gerhard@yahoo.com
miracle47@olson.org
uruecker@kemmer.com
matilda.qkieu@gmail.com
lulu.gerhold@yahoo.com
result will be:
marquardt.gudrun@gmail.com
matilda.qkieu@gmail.com
To match lines that ends with, when calling the command (for example "Filter Lines Matching...") we just need to enter our query ending with a $
so if we enter org$
marquardt.gudrun@gmail.com
miracle47@olson.org
doggyhelp@welovedogs.org.xyz
lulu.gerhold@yahoo.com
result will be:
miracle47@olson.org
To match lines that do not contain some text, when calling the command (for example "Filter Lines Matching...") we just need start our query with a !
so if we enter !gmail.com
we are basically saying keep only lines that do not contain gmail.com
marquardt.gudrun@gmail.com
miracle47@olson.org
doggyhelp@welovedogs.org.xyz
almendra.gerhold@gmail.com
result will be:
miracle47@olson.org
doggyhelp@welovedogs.org.xyz
You can use the power of regular expressions to filter lines for example if you filter using @we.+dogs\.org
we can return lines that have @we
followed by any amount of characters followed by dogs.org
marquardt.gudrun@gmail.com
doggyhelp@welovedogs.org
miracle47@olson.org
humanfrinds@wecarealotfordogs.org
result will be:
doggyhelp@welovedogs.org
humanfrinds@wecarealotfordogs.org
You can use this to quickly make selections by using a regex or regular text for example:
# Given the following code
class Foo(object):
def some(self, arg):
self.bar = arg
self.baz = arg + self.smth
def on_done(self, rx):
self.view = x
def on_change(self, rx):
self.view = x
We can invoque the "Select Ocurrences Matching..." and we can enter def
to select all ocurrences of def, we can also use a regular expression for example def (\w+)\(self, rx\)
this will select on_done
and on_change
If you use regex and there's capture groups then only the groups will be selected.
With this command you can wrap each line with any text you want, you can use $1
as placeholder to represent the line content, for example: <li>$1</li>
Duncan Prewett
Ernesto Gladi
Wava Fodor
Annamarie Dianei
result will be:
<li>Duncan Prewett</li>
<li>Ernesto Gladi</li>
<li>Wava Fodor</li>
<li>Annamarie Dianei</li>
You can join lines with any delimiter you want, for example, if you use a comma as delimiter.
Duncan Prewett
Ernesto Gladi
result will be:
Duncan Prewett,Ernesto Gladi
You can split text with any delimiter you want, for example, if you use a comma as delimiter.
Duncan Prewett,Ernesto Gladi
result will be:
Duncan Prewett
Ernesto Gladi
Really usefull to pretty print some json string, for example:
{"name":"John", "age":30, "car":null}
result will be:
{
"name": "John",
"age": 30,
"car": null
}
It also works for serialized strings in case you grab the value from a database and quickly need to inspect it's content.
s:60:"{"product":"Awesome Product", "price": 200, "shipping":null}";
result will be:
{
"product": "Awesome Product",
"price": 200,
"shipping": null
}
You can easily add or substract all the numbers in your document, each value must be in it's own line, if the line contains other text it will be removed to leave only the numbers. Important: for now it only supports numbers with comma as thousand separator and dot as decimal separator
130.23
Price $2,000.00
Discount 40
result will be:
2170.23
You can create dummy files to test API's, file uploads, etc. The file will be created at the root of your project, with the filename and size provided. You can call the command from the command palette
or from the menu Extensions -> Generate Dummy File
The file name can be anything for example:
myfile (with no extension)
myfile.text
myfile.mp4
myfile.zip
myfile.pdf
myfile.csv
...etc
The file size can be written in multiple ways, it's case insensitive and spaces are ignored.
1500 (if only a number it's entered it will be interpreted as bytes so in this case 1500 bytes)
500kb or 500 kb or 500 kilobytes
200mb or 200 mb or 200 megabytes
2gb or 2 gb or 2 gigabytes
...etc
If you have one in mind do not hestiate to share it with us, if it can help a lot of people we'll surely implement it.
Expand selection is a heavily modified version of the vscode extension expand region and sublime expand region