Sublime Forum

Autocomplete for files in a subdirectory

#1

When I try to open a file in a subdirectory of the current directory (using just the keyboard), I need to do it in two steps. If I’m editing file mysourcefile.js and I want to add file sub/secondfile.js where “sub” is a subdirectory, I used to be able to just hit Ctrl-O, then type “sub/sec” and the autocomplete would kick in and find the file. Now it can’t find anything - I get “No results found”. I don’t know when this changed.

If I hit Ctrl-O then type “sub” and then hit Enter, it goes into the subdirectory and then I can type “sec” and autocomplete works. Is there a way to configure Sublime Text to be able to handle the subdirectory name?

Also, it seems to be doing a full search, i.e. if I type “sec” then any filename that contains “sec” is shown, but in alphabetical order. So “asecond.js” is listed before “secondfile.js”. I want to be able to type the name of the file and have it be selected, i.e. list “sec*” first and then “*sec*” after that. Is this behaviour configurable?

I’m using version 3.2.1 build 3207 on Red Hat.

0 Likes

#2

I beleive that what you’re seeing here is a consequence of the switch to GTK 3 from GTK 2 in the more recent builds. The file dialogs that are presented in Sublime are controlled by that, and they work differently than they used to.

Broadly speaking, the default in GTK 2 was to have a location bar displayed in the dialog that you could type into; typing into the location bar presented the autocompletion you mention above. In GTK 3 the default is to show only the breadcrumbs path bar by default, and when you start typing instead of typing a path, you’re performing a search, which works differently.

You can press Ctrl+L to make the location bar appear and get back the functionality that you want. Unfortunately you have to do it every time you open the dialog.

There is a setting that controls this, but it’s a GTK setting and not a Sublime setting (it’s out of Sublime’s control). Your window manager may have a method by which you can alter the default back to what it used to be.

0 Likes

#3

Thanks for your reply. This appears to be correct. After some searching on GTK3, I’ve found others who are seeing the same thing but have been unable to find a setting to change the default. If I can’t find one, I’ll have to live with it but the Ctrl-L trick is very handy.

0 Likes

#4

I’ve found the setting and tried various ways to flip it to the alternate setting, but in all cases as soon as a file dialog opens the setting reverts back to the default. I’ve been unable to determine if I’m just not doing it correctly or there is something specific in my window manager or the library that’s forcing it the other way.

0 Likes