Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to clear recently opened files from open file dialog #3260

Closed
JordanBelford opened this issue Feb 22, 2016 · 19 comments
Closed

Add ability to clear recently opened files from open file dialog #3260

JordanBelford opened this issue Feb 22, 2016 · 19 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality file-explorer Explorer widget issues workbench-tabs VS Code editor tab issues
Milestone

Comments

@JordanBelford
Copy link

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.

screen shot 2016-02-22 at 11 46 37 am

Sounds similar to #1662, but that one is for clearing recent files from the OSX dock icon.

@Spown
Copy link

Spown commented Feb 22, 2016

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.

@bpasero
Copy link
Member

bpasero commented Feb 29, 2016

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.

@bpasero bpasero added feature-request Request for new features or functionality workbench labels Feb 29, 2016
@bpasero bpasero added this to the Backlog milestone Feb 29, 2016
@bpasero bpasero removed their assignment Feb 29, 2016
@JordanBelford
Copy link
Author

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.

@dotnetCarpenter
Copy link

@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.

@dotnetCarpenter
Copy link

@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.

@dotnetCarpenter
Copy link

@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.

@bpasero
Copy link
Member

bpasero commented Mar 9, 2016

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.

@dotnetCarpenter
Copy link

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?

@dotnetCarpenter
Copy link

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

@bpasero
Copy link
Member

bpasero commented Mar 10, 2016

@dotnetCarpenter it is Ctrl+K Ctrl-P to open the working files picker.

@dotnetCarpenter
Copy link

@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?

@bpasero
Copy link
Member

bpasero commented Mar 14, 2016

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.

@bpasero bpasero added file-explorer Explorer widget issues and removed workbench labels Mar 14, 2016
@bpasero bpasero self-assigned this Mar 30, 2016
@bpasero bpasero added the workbench-tabs VS Code editor tab issues label May 19, 2016
@bpasero bpasero modified the milestones: June 2016, Backlog May 23, 2016
@bpasero
Copy link
Member

bpasero commented May 23, 2016

For June we plan to provide an action that clears:

  • the editor navigation history (Cmd+P)
  • the history of recently closed tabs
  • the forward/backward history

@bpasero bpasero closed this as completed May 30, 2016
@bpasero bpasero added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 27, 2016
@CreepGin
Copy link

For people who got here searching for how to clear the history (cmd+shift+p):

image

Though I must admit, it would be nice to be able to remove specific files from the history.

image

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.

@bpasero
Copy link
Member

bpasero commented Aug 15, 2016

@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.

image

@CreepGin
Copy link

@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.

@dbrodie
Copy link

dbrodie commented Jun 14, 2017

@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.

@bpasero
Copy link
Member

bpasero commented Jun 15, 2017

This command works for any entry, there is no dependency on the file existing on disk or not (there is not even a check).

@dbrodie
Copy link

dbrodie commented Aug 2, 2017

Sorry, you are correct, I misunderstood how to use the feature.
Thank you, works great!

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality file-explorer Explorer widget issues workbench-tabs VS Code editor tab issues
Projects
None yet
Development

No branches or pull requests

6 participants