zed
zed copied to clipboard
VS code keybinding: move item up and down
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
In vs code to move a line up it should be option key + arrow key up or down. Right now it seems to be using control key + command + arrow key up or down.
Environment
Zed: v0.91.3 (stable) OS: macOS 13.4.1 Memory: 32 GiB Architecture: aarch64
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
I wanted the same, and have the following in my ~/.config/zed/keymap.json
[
{
"context": "Editor",
"bindings": {
"alt-up": "editor::MoveLineUp",
"alt-down": "editor::MoveLineDown",
"alt-shift-up": "editor::DuplicateLine",
"alt-shift-down": "editor::DuplicateLine",
}
}
]
editor::DuplicateLine
keeps the cursor on the new line (always "copying down"), while in VSCode you can both copy lines up and down. Is there a paramater for this keybind (e.g. like editor::SelectNext
has replace_newest
)? Is there maybe a page with all available keybindings and their parameters? @JosephTLyons
I think this should work as default.
I think this should work as default.
I'm on Zed version 0.123.2 and I have set base keymap to VSCode. It seems MoveLineUp
MoveLineDown
DuplicateLineUp
DuplicateLineDown
is still not binded to the same as it is in VSCode.
It looks like alt-up
and alt-down
are taken by editor::SelectLargerSyntaxNode
and editor::SelectSmallerSyntaxNode
. But I think those are from JetBrains. The VS Code defaults should be:
{
"context": "Editor",
"bindings": {
"cmd-shift-k": "editor::DeleteLine",
"alt-shift-down": "editor::DuplicateLine",
"alt-down": "editor::MoveLineDown",
"alt-up": "editor::MoveLineUp",
"ctrl-shift-right": "editor::SelectLargerSyntaxNode",
"ctrl-shift-left": "editor::SelectSmallerSyntaxNode"
}
}
Should we just PR that?
I'm going to close this issue as the patch has already been shipped in v0.126.0
.
the patch has already been shipped in
v0.126.0
.
Edit: 8352f39 now in v0.127.0-pre
(mentioned in Breaking changes). Credit to @3ddyBoi for getting it done 🚀