Override default 'p' actions to always pasted from system clipboard. #19818
-
I'm trying to configure zed's vim keybinding to have both y and p to only copy or paste from the system clipboard, while others such as dd and ciw remains as internal register. However, I have no idea how to make p always paste from system clipboard as y is simply set the "use_system_clipboard" value in settings to on yank. I have tried the following keymap configuration but it does not work as expected as I used to with .vimrc file. It will just override the p key and now waiting the last keybind forever, which will not happend at all and the vim command keys shown like this: [
{
"context": "Editor && vim_mode == normal && !menu",
"bindings": {
"p": ["workspace::SendKeystrokes", "\" + p"]
}
}
] Is there anyway to configure zed to tempory ignore the custom keymaps or I have missed something in the keymap configuration file (eg: there's different configs that did similar thing)? Btw I know that easier to just map it to ["workspace::SendKeystrokes": "a cmd-v escape"] but that's works completly different behaviour compare to vim as this issue (More configurable use_system_clipboard of vim mode #11313 ) points out. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Update: I'm currently have a very hacky way by overiding the default to other keybinds and remap p and P to it. It work as what I expected at version v0.158.2 as the following, but I'm not sure if there's any better ways? [
{
"context": "Editor && vim_mode == normal && !menu",
"bindings": {
"space p": "vim::Paste",
"space P": ["vim::Paste", { "before": true }],
"p": ["workspace::SendKeystrokes", "\" + space p"],
"P": ["workspace::SendKeystrokes", "\" + space P"]
}
}
] |
Beta Was this translation helpful? Give feedback.
Update: I'm currently have a very hacky way by overiding the default to other keybinds and remap p and P to it. It work as what I expected at version v0.158.2 as the following, but I'm not sure if there's any better ways?