Clear find results on every new find in Sublime Text

17

6

Is there a way to clear results every time I do a new Find in Sublime Text (version 3 for this case)?

I dont want to have an history of what was searched before in the Find results tab.

lante

Posted 2015-03-26T20:56:27.947

Reputation: 318

This question is confusing. The title and first few lines allude to clearing the panel. Only the last few lines seem to be real intent of the question. – Mrchief – 2017-02-14T21:40:31.583

Are you worried that the history is being logged? Or do you just want the input area to be cleared so you can run a new search? After running a search I believe you can just hit the down arrow key to clear the text currently in the search input (assuming that text input box has focus). – Matt Rohland – 2017-10-06T11:50:27.183

Answers

2

Unfortunately, there doesn't seem to be a built in option to do so in the settings. The only method I know to make Sublime 3 "forget" the searched last strings is to erase them from a session file that is created after closing Sublime.

So, below is the method to make Sublime 3 "forget" the last searched strings from a previous session:

  1. Go to the Local folder of Sublime, which can be found in the app data folder.

    on Windows:

    %appdata%\Sublime Text 3\Local\
    

    On Linux:

    ~/.config/sublime-text-3/Local/
    

    On OSX:

    ~/Library/Application Support/Sublime Text 3/Local/ 
    

In this folder you will have a file called Session.sublime_session.

  1. Edit the file with another editor (say Notepad++), and search for find_history string in it.

  2. Erase the quoted value that found between the brackets (this should be your last search string)

For example, If you have the following shown in the Session.sublime_session file:

"find_state":
{
    "case_sensitive": false,
    "find_history":
    [
        "previously_searched_string"
    ],

Then after the deletion it should look like this:

"find_state":
{
    "case_sensitive": false,
    "find_history":
    [
    ],

You can also write a script that will do so automatically after closing Sublime.

Hope it helps.

Mike

Posted 2015-03-26T20:56:27.947

Reputation: 435

1For OSX the file has moved and is now in ~/Library/Application Support/Sublime Text 3/Local/ – Arthur – 2016-09-27T19:00:36.103

1

You can just close the Find results tab. When you reopen it (using shift+ctrl+f), it will be empty.

cnlevy

Posted 2015-03-26T20:56:27.947

Reputation: 127

4the idea is to clear it without having to close the window – lante – 2016-05-05T16:50:47.340