-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emacs Compatibility Tracking Issue #4856
Comments
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? |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
At least there's an issue for this (go and vote!): |
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
} |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Various improvements to the emacs compatibility keybindings. - See also: #4856 Release Notes: - Improvements to emacs keybindings: - Better support for running emacs inside Zed terminal (e.g. `ctrl-x ctrl-c` will quit emacs in terminal not zed) - `alt-^` Join Lines - `ctrl-/` Undo - `alt-.` GotoDefinition and `alt-,` GoBack - `ctrl-x h` SelectAll - `alt-<` / `alt->` Goto End/Beginning of Buffer - `ctrl-g` as Menu::cancel
This comment was marked as off-topic.
This comment was marked as off-topic.
I've added a bunch of the suggestions provided above and hidden the associated comments to keep this thread from growing out of control. Where possible I'm trying to stick only the actual default emacs keybinds and avoid people's personal binds. Here are some recent improvements which have made their way into Zed:
@rakete Nifty that There's you've managed to build a Mark mode workaround with AutoHotKey. |
I'm a big fan of occur. Would it be too much to add it to a task? Obviously that's functionality that goes well beyond keybindings. |
@dmvianna I don't have any experience using emacs |
It might be worth adding |
@kzar Emacs Similar to this: zed/assets/keymaps/default-linux.json Line 306 in ba7b9b3
zed/crates/editor/src/actions.rs Lines 79 to 85 in ba7b9b3
And then add a conditional inside the newline_below to optionally move the cursor.zed/crates/editor/src/editor.rs Line 3139 in ba7b9b3
|
Good point about not moving the cursor, but I don't think that |
|
Oh, duh.
"ctrl-y": "editor::Paste",
"alt-w": "editor::Copy",
"ctrl-w": "editor::Cut",
"ctrl-?": "editor::Redo",
"ctrl-shift-n": "editor::SelectDown",
"ctrl-shift-p": "editor::SelectUp",
"alt-shift-f": "editor::SelectToNextWordEnd",
"alt-shift-b": "editor::SelectToPreviousWordStart",
"ctrl-alt-shift-f": "editor::SelectToEndOfLine",
"ctrl-alt-shift-b": "editor::SelectToBeginningOfLine" This below also stops the
"alt-x": "app_menu::OpenApplicationMenu",
"ctrl-?": null And this prevents the cursor movement commands from opening new buffers when reaching beyond the first and last lines of a buffer.
"ctrl-n": null,
"ctrl-p": null, |
Another biggie: the kill ring. Basically a copy history that you can browse through by typing There's an issue for it already, it would be nice to have it in the description of this issue too. |
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"] |
"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 |
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.
ctrl-x
than MacOS Terminal (emacs) #16214Comments such as "I need emacs mode to switch to Zed!" and the like are unwelcome here.
Please vote with 👍 below instead.
Editor note (@notpeter): Originally this issue was for an emacs keymap, a beta of which shipped in #19605
The text was updated successfully, but these errors were encountered: