Sublime Forum

Still no replace functionality for Macros?

#1

Seems like it’s been 6 years since the first person brought this up. How is it that an editor as full featured as this one STILL does do something as simple as allowing a replace operation to be recorded as a macro. Im not even talking about regex here. Just a straight, find commas and replace them with new lines.

0 Likes

#2

there’s a huge discussion on this here:

TL;DR: its basically a two line python script to achieve the same thing so macros not having this functionality isn’t a big deal

0 Likes

#3

Sublime Text 4 now supports Find commands in macros.

0 Likes

#4

We don’t need Plugins. Here is the sublime text macro code to replace “War” with “Love”.
[
{
“args”: {“to”: “bof”}, “command”: “move_to”
},
{
“args”: {“characters”: “War”}, “command”: “insert”
},
{
“args”: {“extend”: true, “to”: “bol”}, “command”: “move_to”
},
{
“command”: “slurp_find_string”
},
{
“args”: {“characters”: “Love”}, “command”: “insert”
},
{
“args”: {“extend”: true, “to”: “bol”}, “command”: “move_to”
},
{
“command”: “slurp_replace_string”
},
{
“args”: null, “command”: “left_delete”
},
{
“args”: {“close_panel”: true }, “command”: “replace_all”
},
]

0 Likes