Sublime Forum

How was the search of words/variables called?

#1

Hey :smile:
I was wondering how the way Sublime finds code/words was called.
For example if you had the word firstSecondThird, it is enough to write fst and it would pop in the completion list. Thanks :smile:

0 Likes

#2

Fuzzy Search

0 Likes

#3

Thanks :smile:

0 Likes

#4

Could any one explain me the logic ?

0 Likes

#5

Its really simple actually. Here is an example for finding file with Ctrl+p:
somefolder\foo\bar.cpp

You simply type any of the characters in the path in the same order as they appear. ST will bring up files with matching characters in the provided order. I believe it also favors file-names over path names. so if you typed bar you would get any file that had a B then an A then a R in its path. you could type โ€œsofobarpโ€ and it is most likly you would get this file as a result. with sublime search you can drop any number of letters as long as the ones you type are in the right order.

There are a few other factors to the search but i donโ€™t think they are officially announced. Like i think it favors files that are close to the current file, or the search favors files with longer strings of matching characters.

0 Likes