Emacs Compatibility Tracking Issue #23629
Replies: 40 comments 3 replies
-
An offical "Emacs mode" would be really nice. There is a couple of example user configurations over here: https://github.com/zed-industries/community/discussions/1653 At the moment the lack of a "mark" command is the biggest holdup. In Emacs, pressing Ctrl+SPC will toggle selection and let you use movement commands to select text without keeping Shift pressed. Any chance this could be added to Zed? |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
This comment has been minimized.
This comment has been minimized.
This comment was marked as spam.
This comment was marked as spam.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been hidden.
This comment has been hidden.
-
For those following this issue we've recently shipped two emacs-related improvements: Please try out the It's very basic at this point, but give it a whirl, happy to consider PRs with improvements / refinements. Rather than close this issue I've repurposed it as a tracking issue for additional Emacs-related enhancements and I've edited the issue description above to include links to other issues. One other update, sadly, due to issues with international keyboards we also opted to revert If you need emacs/readline style keybinds in your terminal which use "terminal": {
"option_as_meta": true
} |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
This comment has been minimized.
This comment has been minimized.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been minimized.
This comment has been minimized.
-
Moving around the workspace panes is different from Emacs, which will just cycle through all available buffers and has no default concept of how they're positioned. Zed seems to organise them spatially, so instead of having just the default Emacs In Emacs, I go to the pane I want the buffer to be and switch to it by name. In Zed (at least for now), I have to locate the pane by looking at the tabs, switching to the pane and then choosing the desired tab. Suboptimal. Here's my current config:
"ctrl-x o": "tab_switcher::Toggle",
"alt-x b": ["workspace::ActivatePaneInDirection", "Left"],
"alt-x f": ["workspace::ActivatePaneInDirection", "Right"],
"alt-x p": ["workspace::ActivatePaneInDirection", "Up"],
"alt-x n": ["workspace::ActivatePaneInDirection", "Down"] |
Beta Was this translation helpful? Give feedback.
-
"alt-,": "pane::GoBack", // xref-go-back
"ctrl-x ctrl-space": "pane::GoBack", // pop-global-mark
"ctrl-u ctrl-space": "pane::GoForward" // set-mark-command with negative prefix Typing |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
Tomorrow (2025-01-21) this will be available Zed Preview 0.171.x (#23297 and #23428):
Note multi-cursor is supported for both. video demoScreen.Recording.2025-01-21.at.18.17.59.movThanks @ozanmakes for your work on #22904 which inspired me to get this over the line. |
Beta Was this translation helpful? Give feedback.
-
Zed is getting more and more usable for me (as a long-time Emacs user) with these changes, thanks @notpeter! I've not had the latest upgrade yet, but something I've noticed recently. If I press |
Beta Was this translation helpful? Give feedback.
-
Thanks for this! Zed is incredibly fast. This was one of my stoppers to finally switch over. |
Beta Was this translation helpful? Give feedback.
-
I'm trying this Emacs keymap, one thing I'm confused about is how it should handle conflicts with default Zed keybinds, eg C-p instead of going to previous line currently opens project file search and C-a selects all instead of going to beginning of a line. |
Beta Was this translation helpful? Give feedback.
-
You're probably missing the
|
Beta Was this translation helpful? Give feedback.
-
I do have that, and I have some Emacs keybinds working, like C-n, C-e, but only those which are not used by Zed default bindings |
Beta Was this translation helpful? Give feedback.
-
I'm in Zed
And my |
Beta Was this translation helpful? Give feedback.
-
In Emacs, one can bind the same keyboard shortcut to different commands in different programming language buffers. It would be great if Zed had similar functionality. For example, using the same shortcut to execute different run commands / tasks in Python and Rust files, e.g. |
Beta Was this translation helpful? Give feedback.
-
To help Emacs folks migrate, can I suggest adding feedback for when the user used the command palette for a command that already has a key binding. That way, folks can pick up the keybindings as they go. I've been finding I need to use the command pallete to find what I need (e.g. "file finder: toggle"), then go through the default keymap myself to find what that's bound to.
In Emacs, a message like You can run the command ‘forward-char’ with C-f is shown in the mini buffer, so the user can quickly pick up the binding for next time.
Second this. I used the dropdown boxes to discover command names and current keybindings in Zed, but a `which-key` functionality where the keybindings are shown alongside the commands in the pallette would be much more useful as it would cover all commands and be readily accessible.-- Daniel Vianna
|
Beta Was this translation helpful? Give feedback.
-
I've moved this to a discussion because we're working to tidy up the Issue Tracker. We'll see how it goes. Re which-key: |
Beta Was this translation helpful? Give feedback.
-
What do you think about support for s-expressions ("sexp" for short), like Link to the GNU Emacs Manual: https://www.gnu.org/software/emacs/manual/html_node/emacs/Expressions.html |
Beta Was this translation helpful? Give feedback.
-
Hey @notpeter I've updated Zed to 0.171.3 and I can confirm
Thanks! |
Beta Was this translation helpful? Give feedback.
-
Rather than a monolithic "implement emacs in Zed" enhancement request (which is inherently unactionable) this issue is a tracking issue for centralizing various Zed bug fixes and enhancements to better supporting emacs-like compatibility and operation in Zed.
Issues:
ctrl-x
than MacOS Terminal (emacs) #16214occur
style) #22943keep lines
andflush lines
command #23408Merged PRs:
editor::SwapSelectionEnds
everywhere (emacs exchange-point-and-mark) #23428Comments such as "I need emacs mode to switch to Zed!" and the like are unwelcome here.
Please vote with 👍 below on this issue and the linked issues instead.
Editor note (@notpeter): Originally this issue was for an emacs keymap, a beta of which shipped in #19605
Beta Was this translation helpful? Give feedback.
All reactions