As far as I can tell, there is no way to clear the list of recently opened files that appears on the CMD+P window.
My problem: I have excluded node_modules from searching. Sometimes I open a package.json file from inside node_modules by navigating from the explorer.
After that, CMD+P then typing 'package.json' shows all of the package.json files that are in the recently opened list, even though some are from the node_modules directory which is normally excluded from search.
This can be useful behavior, but the user should be able to clear out the recently opened list so that the search exclusion rules can go back to hiding those files.
There should be a clear all recently opened files button/command. It may be worth considering a way to clear specific items with an 'x' on the open file dialog that appears with CMD+P. Or perhaps a special command for clearing recently opened files that match any search exclusion rules.
Sounds similar to #1662, but that one is for clearing recent files from the OSX dock icon.
This is somewhat related to my issue #3215 since every time an unwanted file is opened via debugger - it puts itself into the dropdown list. So almost after any debug session it gets even harder to restore the workspace because the originally opened in that edit view file drops on the bottom of totally cluttered with trash list.
You can remove entries from the list by opening an entry and invoking the "Close File" command (Cmd+K W).
I do agree though that it is nice to have more control over the recent list.
Thanks @bpasero. The 'Close File' command solves my problem. If this feature gets implemented, it would still make managing the recent list more efficient and intuitive.
It seems odd that clicking to remove files from the 'Working Files' list does not remove the files from the recently used list.
@JordanBelford I was thinking the same. @bpasero How about syncing _WORKING FILES_ and _recently opened_?
I usually navigate through my files via ctrl + tab
and ctrl + shift + tab
but control which files I work with in _WORKING FILES_. Since open files automagically ends up in _WORKNG FILES_ it is nice a UX if I can control my files navigation through _WORKNG FILES_.
@bpasero In case you guys go with my proposed file navigation flow, then _recently opened_ should be renamed to _working files_.
About the _recently opened_ files feature - I don't have any need for it.
@bpasero just found your answer: http://stackoverflow.com/questions/30813614/keyboard-shortcuts-for-navigating-working-files-in-vscode
The shortcut is Cmd+K Up and Cmd+K Down (on Windows use the Ctrl key).
IMHO, that's is annoying.Navigate history
is much nice - only it should be _WORKING FILES_.
Gonna re-map the keyboard to work as I proposed but is sorely missing the UI from the Navigate history
.
In our latest release you can quick open working files, you can also have a key binding for it. Use the ~ prefix in quick open to get that list.
Not sure what you mean. Do you mean ctrl+k+down
or ctrl+p
and then ~
? Anyway, ctrl+k+down
cycles down through the _working files_ but without the nice UI dropdown list that is right in front of my eyes. Instead I have to look to the upper left of the screen which is great deal slower once you get used to use _recently opened_.
My point is, that _working files_ is my recent files because each file I open ends up in the _working files_ list. The UX for _recently opened_ files is extremely well done but lack the ease of removing files I don't want to cycle through.
So vscode has two almost identical features, where one is easy to manage (_working files_) and the other is easy to use (_recently opened_).
Why not merge the two features?
Just to be clear. Don't change the UI. Just keep _working files_ and _recently opened_ in sync. Try it out in a beta. I'm sure it will prove to be a very nice UX
@dotnetCarpenter it is Ctrl+K Ctrl-P
to open the working files picker.
@bpasero thanks. Is there any way to map file navigation through _workingFilesPicker_? I would like the same UX as tapping through _recent files_ but I can't find the right commands.
First I tried with
{
"key": "ctrl+tab",
"command": "workbench.files.action.openNextWorkingFile"
},
{
"key": "ctrl+shift+tab",
"command": "workbench.files.action.openPreviousWorkingFile"
}
But that quick change through the _working files_ which is a bit too much screen flickering. I then tried with
{
"key": "ctrl+tab",
"command": "workbench.files.action.workingFilesPicker"
}
But that just opens the file picker. Is there commands for cycling through the _workingFilesPicker_ in the same manner as _recent files_?
The ones triggering navigation in any quick open are:
{ "key": "ctrl+tab", "command": "workbench.action.quickOpenNavigateNext",
"when": "inQuickOpen" },
{ "key": "ctrl+shift+tab", "command": "workbench.action.quickOpenNavigatePrevious",
"when": "inQuickOpen" }
You can try it out now already by first typing the keybinding for working files list and then Ctrl+Tab. You can rebind those keys to get what you want.
For June we plan to provide an action that clears:
For people who got here searching for how to clear the history (cmd+shift+p):
Though I must admit, it would be nice to be able to remove specific files from the history.
Adding a "X" icon next to each item sounds good to me. This way we don't need to clear the entire history to get just one bad item out of there.
@CreepGin you can use the "Remove from Editor History" command to remove one entry from the list. It will open the picker to select a file to remove. I know this is not the ideal UI but is a workaround for not having "X" in the list.
@bpasero Thanks! That'll do it for now.
As several others have pointed out in issues regarding the Recently Opened list (cmd+p), a config option such as history.exclude
may be in order. Or, have the Recently Opened list respect search.exclude
.
This is because the Recently Opened list is always prone to containing bad items as time goes on and we accidentally open unwanted files in the editor.
@bpasero Sadly that doesn't work for files that don't exist anymore. I had a file that was moved and I couldn't remove the old file.
This command works for any entry, there is no dependency on the file existing on disk or not (there is not even a check).
Sorry, you are correct, I misunderstood how to use the feature.
Thank you, works great!
Most helpful comment
For people who got here searching for how to clear the history (cmd+shift+p):
Though I must admit, it would be nice to be able to remove specific files from the history.
Adding a "X" icon next to each item sounds good to me. This way we don't need to clear the entire history to get just one bad item out of there.