Sublime Forum

Pre-populate text in replace panel

#1

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:

find-and-replace

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!!

0 Likes

#2

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

#4

Got it!
Thanks a lot @UltraInstinct05!

0 Likes