I've been digging into Sublime's snippets, plugins and macros, but I can't seem to find what I'm looking for.
I'm trying to turn this:
.content {
color: @blue;
}
Into this:
.content {
color: darken(@blue, 5%);
}
Ideally, I'd be able to select the @blue
part, hit a command, and wrap the whole thing properly.
Any ideas? Is this even possible?
As can be seen here:
Tools -> New Snippet... -> save as
darken.sublime-snippet
inData\Packages\User\
And keybind:
EDIT: It would be even better if you add
$1
right after the$SELECTION
, then the cursor will jump to the selected word or right in the place where it has to be written if it's not selected.Change the above snippet's second line to this: