Sublime Forum

Clear Find/ Search history

#1

Maybe I missing the obvious, but how do you clear the search history in Sublime text?

0 Likes

#2

There’s really no easy way (at least that I know of) but if you still want to do it here’s how lol:

Sublime keeps all the history in this file:
%AppData%\Sublime Text\Options\Session.sublime-session
Under the “” tag.

Do a search for findHistory and there you can just erase whatever is after that or whatever you want in that line.

Same goes for if you want to erase **replaceHistory **, consoleHistory, recentFiles and recentProjects

0 Likes

#3

Thank you. I don’t think that was obvious, but thanks for pointing me in the correct direction. This seems very fascinating, but trying to figure how to configure something seems like a alot of trial and error and then you do not know if you are really correct. Like how do you make the vertical edge show?

0 Likes

#4

Is called rulers in settings and it can be set on or off by filetype or globally on for all types
basically you do rulers 80 to display the vertical line at 80 characters…
Is this what you’re talking about? If not please explain :smile:

As you can see by default in (top menu: preferences > default file preferences)

# Columns in which to display vertical rulers, space separated rulers
they are off by default.

by the way if you do rulers 20 30 40 50 60 it’ll display all those in their respective columns, a feature I have yet to see in others editors.

0 Likes

#5

[quote]Is called rulers in settings and it can be set on or off by filetype or globally on for all types
basically you do rulers 80 to display the vertical line at 80 characters… [/quote]

Yes this is what I am talking about. I had just said rulers true and set the wrapWidth, but I see I needed to put a number by rulers in order for it to work. Thank you once again EJ12N

0 Likes

#6

Your welcome have fun subliming :smile:

0 Likes

#7

I’m using version 3 so the tags to look for are a bit different.

ie. file_history, find_in_files, find_state, incremental_find, auto_complete, etc.

However, the biggest difference, I believe, is these tags are located in two places in the same file.

Firstly they are nested under the “settings”: tag.
They are also under the “windows”: tag further down the file.

Not having checked a version 2 file I am not 100% sure they also aren’t listed twice.

So you should probably delete the same lines from each section. Not sure what would result from mismatched histories.
Doesn’t appear to have messed up my setup.

Edit:
Having tried this, at least for me, it doesn’t work. With just Notepad, making sure ST3 was not loaded, I cleared all the entries for the ‘find history’. The file was clear of any references to any of my recent searches. Upon starting ST3, ALL the previously deleted searches were back.

Clearly there are some other places on the system that store these details.

Edit 2:
I must have done something wrong before because it works as expected.
Clear the data in both sections and history is cleared.

I don’t know why I thought it would be stored elsewhere, paranoid I guess. All those other programs writing stupid stuff to the registry. I should have realised that a cross-platform program as good as this one, would make things like this as easy as possible.

Edit 3:
As usual I spoke too soon. There of course more locations where your history is stored. Every project stores its own settings in a session file and everytime you load that project ALL the history is loaded back into the general session file again.

This is stupid! Separating the histories into their own projects is a good idea. Making those settings reload into the general settings is not.
Please make a simple command to clear the general history AND to clear project histories.

0 Likes