Disable "Recently used" in GTK file/directory selector

Note: This answer is for GTK3; all other answers only work for GTK2.

To disable the recent files list, add the following to ~/.config/gtk-3.0/settings.ini (create it and its directory if needed):

[Settings]
gtk-recent-files-enabled=0

To pre-select the current working directory, run

dconf write /org/gtk/settings/file-chooser/startup-mode \"cwd\"

or use a GUI program like dconf-editor.


@MartinVegter

There is a file ~/.config/gtk-2.0/gtkfilechooser.ini. It should look like Stefano wrote:

[Filechooser settings]
LocationMode=path-bar
ShowHidden=false
ShowSizeColumn=true
GeometryX=377
GeometryY=132
GeometryWidth=612
GeometryHeight=528
SortColumn=name
SortOrder=ascending
StartupMode=recent

There was no DefaultFolder variable in this file, but I found the StartupMode=recent var which I changed to StartupMode=cwd. This only works on GTK 2 applications like mousepad.

I don't know there is settings file for GTK 3 apps like gedit, but it seems that GTK 3 filechooser already sets the location to the current folder by default.


Actually you can disable it: open or create ~/.config/gtk-2.0/gtkfilechooser.ini and add these lines to it:

[Filechooser Settings]
DefaultFolder=cwd

Replace cwd with last if you prefer to start with last selected folder instead.

I think this hidden option should also work for gtk3, but I did not test it.