zed
zed copied to clipboard
Add `editor::SendText` action for more flexible keybindings
Check for existing issues
- [X] Completed
Describe the feature
I use a German keyboard with umlauts (ö,ä,ü) and like to remap them in the Editor and in the Terminal. It works in the Terminal.
Here is my working keymap.json
:
[
{
"bindings": {
"cmd-+": "zed::IncreaseBufferFontSize"
}
},
{
"context": "Terminal",
"bindings": {
"ö": [
"terminal::SendText",
"["
],
"ä": [
"terminal::SendText",
"]"
],
"Ö": [
"terminal::SendText",
"{"
],
"Ä": [
"terminal::SendText",
"}"
],
"alt-ö": [
"terminal::SendText",
"ö"
],
"alt-ä": [
"terminal::SendText",
"ä"
],
"alt-Ö": [
"terminal::SendText",
"Ö"
],
"alt-Ä": [
"terminal::SendText",
"Ä"
]
}
}
]
I can already capture umlaut keypresses and trigger other actions in the Editor. This means the editor is already able to intercept regular key presses and not just with modifiers.
This works for instance:
"bindings": {
"ö": "workspace::Welcome"
}
The Terminal already has a SendText
action. Please also "enable" this in the Editor.
If applicable, add mockups / screenshots to help present your vision of the feature
No response
Hey, I'm going to hop on this; I think that I have a similar question(s).
- What must be done to apply the key bindings. Is a simple save of
~/.config/zed/keymap.json
sufficient, or need I restart the application? - I can't seem to get the
terminal::SendText
action to work. More below:
What I want to do: Send lines of code from the current file open down to be executed in the terminal. This is really nice when I am working on computing clusters in a REPL environment and editing files locally. I have this setup in VSCode:
{
"key": "cmd+enter",
"command": "workbench.action.terminal.runSelectedText",
"when": "editorTextFocus"
}
Let me know how I might achieve this, and thank you!
I too am looking for a way to run the current line, or highlighted code, by sending it to the currently active terminal.
Hello,
I second this. The following config works only if the terminal is already in focus:
{
"context": "Workspace",
"bindings": {
"ctrl-alt-u": ["terminal::SendText", "my-command\n"]
}
}
It would be nice if it would work from anywhere.