zed
zed copied to clipboard
Tab Switcher MVP
Draft of the Tab Switcher (#7653), just to gather feedback, if any.
Release Notes:
- Added Tab Switcher
Current state:
https://github.com/zed-industries/zed/assets/2101250/863ca50a-d041-4c11-855e-c51bb6953abe
I really like the feature! But I'm missing a default keybind configuration for it.
I really like the feature! But I'm missing a default keybind configuration for it.
What keybinding do you think should be the default one for the tab switchier?
I also prefer having a shortcut to this feature, but none of the editors/IDEs I use provide it. VSCode doesn't even allow to set a custom one. I guess, the vast majority of the users prefer just clicking tabs, or navigate through them in some other manner. So I'm hesitant to propose a default keybinding, given that the user can always set the one he or she prefers.
Ctrl+Tab in VS Code gives you something similar so that may be a reasonable keyboard shortcut. That is also common behavior in web browsers to page through your tabs with Ctrl+Tab. An alternative that comes to mind is Cmd+B because I think of tabs as buffers as a vim user.
@fostertheweb, you're right, ctrl+tab
in VSCode is a good example of how the tab switcher could look and behave. In the JetBrains products it works the same way, but provides more functionality. Unfortunately, the current state of the shortcuts handling in Zed doesn't allow to implement such behaviour easily (the same problem with the cmd+p
in the file finder), but I'll give it another look.
cmd+b
is already taken for the left dock show/hide, though cmd-k cmd-b
is still vacant :)
Regarding the key bindings, it’s just my personal opinion:
- shift-shift: JetBrains
- shift-`: More affectionate
cmd+b
is already taken for the left dock show/hide, thoughcmd-k cmd-b
is still vacant :)
Whoops! I dock everything to the right so I had no idea.
I wonder how much more work it would be to allow for Ctrl+Tab.
I wonder how much more work it would be to allow for Ctrl+Tab.
Here's a discussion of this feature: Action Release trigger
@mikayla-maki, thanks for your help with mouse clicks!
Well I discovered that CTRL-` will cycle between the shell and the upper pane so that's what I was looking for.
I found it confusing that the keymap for the tab switcher was only in the Workspace context. I added the bindings to the Editor context too as that's where I usually am moving betwween files. Did I miss something obvious?
@samjeffress, workspace contains editors, so whatever binding you add to the workspace context should work in the editor context too. Doesn't ctrl+tab
work for you in an editor with the default configuration?
@alygin with no custom bindings for "ctrl-tab", pressing "ctrl-tab" toggles between tabs without showing the list of open tabs (when in the editor). When I add the following to keymap.json the tab switcher appears:
{
"context": "Editor",
"bindings": {
"ctrl-tab": "tab_switcher::Toggle",
"ctrl-shift-tab": [
"tab_switcher::Toggle",
{
"select_last": true
}
]
}
},
Hi @samjeffress , Any idea on how to do this better with vim mode on? Just like we do in telescope?