zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
44.44k stars 2.4k forks source link

Recently open files palette #4663

Open rtorr opened 1 year ago

rtorr commented 1 year ago

Check for existing issues

Describe the feature

In other editors (vscode/intellij), they provide a palette with recently open files. You can either fuzzy search or go through the list manually with arrow keys (I usually set a different keybinding for selecting which file). When you arrow down, as the selection changes, the editor will update with that selected file. Hitting enter will dismiss the palette.

I do this because I like to hide editor tabs (another feature request for another time?) and only select recently opened files through this pane.

To demo this flow in vscode, these are the keybindings I use and the commands.

  {
    "key": "cmd+e",
    "command": "workbench.action.openPreviousEditorFromHistory"
  },
  {
    "key": "cmd+e",
    "command": "workbench.action.quickOpenNavigateNext",
    "when": "inQuickOpen"
  },

If applicable, add mockups / screenshots to help present your vision of the feature

No response

iamnbutler commented 1 year ago

Have you used cmd + p before? Similar to the command palette, it lists recently open files, and you can search for files across your project.

You can also use cmd + option + o to do the same for recently opened projects. There is also an upcoming palette to do the same with git branches.

Is there some value to you specifically to match only recently opened files in the fuzzy search in the cmd + p palette?

JosephTLyons commented 1 year ago

I think what we are missing here for you is the ability to live load the file, while traversing the list of previously-opened files, and the abillity to customize the the bindings for navigating those files. Does that seem correct?

tychedelia commented 1 year ago

Is there some value to you specifically to match only recently opened files in the fuzzy search in the cmd + p palette?

One simple issue I have with the cmd + p action right now is that it always lists the currently open file at the top. Instead, it should show the most recent file, which would allow you to bounce between the two most recently opened files by repeating cmd + p. This is an interaction I use all the time and feels really painful being missing.

More generally, I think this represents a different kind of editing style that eschews tabs for the concepts of "buffers" or recent locations (see IntelliJ). Basically, I don't want to operate on "open files" or see tabs at all in UI (see also https://github.com/zed-industries/zed/issues/4963). Ideally it should also be possible to "remove" recent files (the equivalent of closing the tab).

An example of my workspace from IntelliJ of "recent locations" which is even better than recent files: image

tychedelia commented 1 year ago

Another example of where project files falls short is pseudo-files or buffers like the center terminal tab(s), which should be searchable so you don't have to click to navigate.

tychedelia commented 1 year ago

The tabs issue is currently being tracked here https://github.com/zed-industries/zed/issues/4963. I agree that these are very closely linked and roll up into a bigger "tabless editing" feature, although I'm not sure if that would be helpful to track on its own.

tychedelia commented 1 year ago

Okay, actually the behavior in IntelliJ is a little more subtle. It's not that the currently opened file is ignored in the recent files, it's that it automatically selects the second entry in the list, allowing you to quickly switch back and forth.

image
rtorr commented 11 months ago

Yes, exactly. It is all about the shortcuts as well.

gatspy commented 1 month ago

I hope that folders and files can be dragged into panel like the sublime, and the next startup still keep them intact.