zed
zed copied to clipboard
Request for default adoption of Ctrl + Tab for tab navigation
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
I have found that Zed employs Ctrl + - as a keyboard shortcut for tab navigation, which diverges from the widely recognized Ctrl + Tab combination. The current choice is unconventional and unexpected, thus I would like to suggest considering the adoption of the standard Ctrl + Tab shortcut by default, for convenience and a more intuitive experience.
Environment
Zed: v0.120.6 (Zed)
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your ~/Library/Logs/Zed/Zed.log
file to this issue.
If you only need the most recent lines, you can run the zed: open log
command palette action to see the last 1000.
No response
CTRL
+ Tab
is different from CTRL
+ -
and it's reverse counterpart CTRL
+ SHIFT
+ -
You're referring to pane switching, either in the "alt-tab"-way where you switch between last active window. The current implementation is more akin "back" and "forward" buttons of a browser, and is on-par with other implementations, at least in VSCode.
@alber70g I'm not sure how to read your comment, but I feel I need to clarify one thing: by "tab navigation" I mean going to the next/previous tab. In a web browser that would be switching between tabs (Ctrl [+ Shift] + Tab), as opposed to navigating through history (Cmd + < and Cmd + >). I might have used the wrong terminology without realising it might lead to confusion.
As a side note, Ctrl + Tab and Ctrl + - both seem to be doing the same thing in VSCode: switching between tabs. I didn't even know about Ctrl + - until Zed...
@alexei
I was able to configure this by adding ↓ to my keymap.json
[
{
"context": "Editor",
"bindings": {
"ctrl-shift-tab": "pane::ActivatePrevItem",
"ctrl-tab": "pane::ActivateNextItem"
}
}
]
The keymap bindings suggested by @yuk0ga allow you to move to the tab to the right or tab to the left of the current tab. This is not what other editors do. ctrl+tab
should take you back in history and ctrl+shift+tab
should take you forward in history (MRU - Most Rencently Used).
Unless you only have 2 tabs open or you like to manually re-order your tabs regularly, moving between tabs to the left or right is not so useful.
This is my main dealbreaker as well since I'm so used to it.
@alexei I was able to configure this by adding ↓ to my
keymap.json
[ { "context": "Editor", "bindings": { "ctrl-shift-tab": "pane::ActivatePrevItem", "ctrl-tab": "pane::ActivateNextItem" } } ]
This only selects the next and previous ones but not the latest active ones. I can't find the option. Do you know if it is possible to get the same behaviour as in VS Code as well?
I also need a way to move tabs to the left or right, something like pane::MoveToLeft
and pane::MoveToRight
.
This is a deal braker. ctrl-tab should take me to the previous active tab I don't use ctrl-shift-tab
Not only ctrl-tab does not work and cannot be configured in cycle mode, as soon as I select file in the files panel, no keyboard shortcut works for switching tabs!
Why ruin the experience of such a fast editor ?
Plus one on dealbreaker unfortunately. This is the way I'm used to navigating tabs. I actually do not want to show tabs at all, but always just use ctrl-tab for navigating by MRU. It's such muscle memory now that I cannot use an editor without it. Or maybe I'll try if I can do with:
"ctrl-tab": "pane::ActivateLastItem",
"alt-cmd-left": "pane::GoBack",
"alt-cmd-right": "pane::GoForward"
for popping one item in the MRU-stack with ctrl-tab and resolve to arrow navigation if I need to go further.
Update: Nah, it really doesn't work for me without an MRU-stack. Just can't get used to it.
i am currently searching for a solution for the same issue and landed here. the core problem seems to be, that zed does not even seem to have a concept of a "active tab history".
it basically is the list in the ⌘ + P file search (called file_finder
in the default keymap), so we would need an action, that brings the tab of the last item (the top one) on that list to the front, if that file is currently open.
what vscode does, is opening the list, selecting the last item and bringing it to the front on release of the ctrl key. when the ctrl is not released, but tab is pressed again, it moves down the list by one item.
this also is the behaviour most people would expect, i assume. ctrl + shift + tab does the same thing, but starting from the bottom.
in conclusion, we would need a new action, that:
- opens the
file_finder
on press of a key combination - selects the most recent item
- selects the next item in that list, as long as the modifier key is still pressed
- brings the corresponding tab to the foreground on release of the modifier key
and additionally an action, that does the same, but from the bottom up.
+1 its pretty annoying. What I feel users want is:
- Cmd/Ctrl + Tab ==> Switch to last active tab. Pressing the shortcut again should bring to back to the OG tab
- Cmd + 1/2/3/4/... ===> Switch to particular tab
This should be the default behavior IMO, especially if you want ppl to ditch Vscode
This was implemented in: https://github.com/zed-industries/zed/pull/7987, and should be available as of 0.130.0 (two weeks from now).
Hi can someone pls point out how to do this with vim mode?
"context": "Pane",
"bindings": {
"shift h": "pane::ActivatePrevItem",
"shift l": "pane::ActivateNextItem"
}
}
The above doesn't seem to work with vim mode. Thanks