Reputation: 1248
Using the quick open shortcut (CTRL/CMD + P) to navigate files always put the recently opened files first, then the file results.
I would like it to show me only the file results, or at least put them first, but I can't find any options that would do this. Does it exists? Or do I just lack the right term to search ?
Upvotes: 7
Views: 6878
Reputation: 50225
(besides the obvious, non-ideal solution of manually clicking the "x" button to "forget" memory of each of those recent files,)
VS Code 1.28 added the search.quickOpen.includeHistory
setting, which you can set to false
to get roughly what you want. The relevant issue ticket is Allow disable of recent history in "go to file" command #30770. Note Benjamin Pasero's comment at the end of that issue ticket, which says:
The list of recently opened is still shown when initially opening quick open or having no search at all.
This is confirmed by their thumbs up here and their comment here to be by-design.
In VS Code 1.88, you can at least skip between sections in Quick Open by using alt+up/down on Windows and Linux, and on macOS, use cmd+up/down. See related release notes. So if you want to skip past all recent files, that's an option.
Upvotes: 1
Reputation: 2152
Use this in your VS Code settings (Code -> Preferences -> Settings in macOS, File > Preferences > Settings on Windows/Linux). Open the Settings in JSON format (document icon on the top right of the tab bar), and add:
"search.quickOpen.includeHistory": false
Upvotes: 14
Reputation: 6049
I am adding this answer just to give a description of that property. All credits to @Hejazzman.
"search.quickOpen.includeHistory": false, // by default is true
This setting was released of VS code version 1.28 in September 2018. According to the official release documentation,
A new setting allows you to control if files that were recently opened should be part of the Quick Open file picker. By default, files that were recently opened will appear to the top of the search and other files from the workspace below. If you would prefer to not see recently opened files on top, you can change this setting to false.
Upvotes: 0