Sublime Forum

Pre-populate text in replace panel


Hey guys, I hope you are doing great.

I’m working on a plugin to bring some of my favorite vim’s commands to Sublime Text. (I do use the “Vintage” package but I’m trying to add some missing pieces here and there. For instance, search and replace.)

The code is almost working but there is one missing step: completing the “replace with” input field.

This is the plugin in action:


I’m trying to emulate vim’s “substitute” command, which is basically, find and replace.

%s/foo/bar/ means substitute “foo” with “bar” on the current file.

This is the code I got so far:

Is there a way to move to the next input or pass that “replace text” as an argument to the panel?

Any tip will be much appreciated.

Thanks in advance!!



The insert command works because when the panel is opened, the focus is in the Find input, but there is no way (?) I know of which can be used to populate the Replace field. There is an open issue about it

1 Like


Got it!
Thanks a lot @UltraInstinct05!