zed
zed copied to clipboard
Tab Switcher
Check for existing issues
- [X] Completed
Describe the feature
When working on tabless editing mode (#6424), there was a discussion about the need to implement Tab Switcher -- a panel similar to the File Finder that would show the list of opened tabs in the active pane and allow to switch between them and close them right in this panel.
I tried to figure out how such switcher could look and how it could be implemented, and decided to file it as a separate feature request, because there's a lot of things to discuss (and probably to change in the code).
How it will look and work
- Default shortcut is
ctrl-tab
. It also moves selection to the next item. - Selection is confirmed by either releasing of a modifier key (
ctrl
by default) or with a mouse click. - Items are sorted in the reverse order of the tab activation history.
- Second item (if exists) is selected by default. This will allow to switch to the previous tab with a single keystroke.
- We need item icons here to distinguish files from terminal, search results etc.
- Close button is displayed when hover over item.
- Implemented using the existing Picker functionality, but with the query editor hidden.
Tasks
- [ ] Implement #8757
- [ ] Implement headless picker
- [ ] Implement tab switcher
How others do this
See comments below:
Related issues and PRs
- #6424
- https://github.com/zed-industries/zed/pull/2742#issuecomment-1638903687
- #7356
- #8757
VSCode
VSCode has several features that allow the user to naviage between opened tabs:
- Tab switcher, as described above, available through
ctrl+tab
shortcut:
- Tab bar dropdown menu wit the "Show Opened Editors" action in it:
When clicked, it displays a panel that is very similar to File Finder. Tabs of the selected pane (group) are listed in the reverse history order. Name, path, git status, modification mark etc. are the same as in the tabs, including the Close button:
- VSCode also has the Open Editors panel that can be displayed in the left pane, along with the project structure:
VSCode doesn't have a setting that would allow to automatically close tabs when there're too many of them.
Jet Brains IDEA
~IDEA doesn't provide such feature~
See @alexander-irbis's comment: https://github.com/zed-industries/zed/issues/7653#issuecomment-1990820785
Sublime Text
Sublime Text has an "Add" button and a simple dropdown list with opened tabs:
If Zed had a unified bufferline this wouldn't be an issue.
IDEA doesn't provide such feature
Idea provides such feature (with additional options where to switch). Also it allows to select elements in the list with arrows (while Ctrl is pressed).
Idea provides such feature
You're right, thanks for pointing that out! I've added a link to your comment.
If Zed supports ctrl-tab to switch between recent tabs the way VSCode and Firefox do, that will be great.
Nice one! I hope a fuzzy-search feature can be added too, it is so convenient to use it after trying it in Emacs.
@maximvl Filterable tab switcher would be very helpful. I also miss the ctrl-x b
(switch-to-buffer
) in Emacs.