Sublime Forum

Preserving text search history

#1

I have a workflow where I’m opening lots of one-off windows which are a png paired with the OCRed text of the image. I’m opening them from the command line:

subl -n $PNG_PATH $MD_PATH --command new_pane

I’m then searching for things within the text, but it’s often the same thing for 20ish pages, then it switches to something else. Sometimes it’s a regex, other times just a plain string.

What I’d really prefer is to have the search string (and any settings, like case and regex) preserved every time I open a new window. What would be REALLY swell would be to have the history of queries I’ve used recently in the menu on the right. As I understand it, that behavior was disabled in 2018 without a setting. The only workaround seems to be to use a project.

I’ve tried doing this with the context of a project, but I ran into some issues. First, I have to close all open panes each time I open a new window, which sesems to require a plugin. I have vibecoded that plugin, but Sublime sometimes complains about closing panes even when they haven’t been modified. :thinking:

More fundamentally, I can only figure out how to have one copy of the project open at a time. Is there a way to change this? I want to be able to have several windows (document pairs) open at once, which I can with my current workflow.

If using a project is a dead end, is there some toggle (or reasonably simple plugin) that I’m missing which will let me preserve or re-set the search settings when I open a new window?

0 Likes

#2

I have noticed a helpful quirk. When I open several windows, even without tying any of them to a Project, they share the search. So I can search for a string in one window, then close it, and use Cmd+G in the next window.

The caveat is that this seems to only work for all the windows open at a given time. So if I open more windows, the new windows will have empty search queries. This happens even if I open the new windows while one window remains. TBH, the current behavior is pretty unpredictable.

0 Likes

#3
1 Like