2022-04-21 20:33:39 +00:00
|
|
|
[
|
2024-05-10 17:40:08 +00:00
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "VimControl && !menu",
|
2022-07-27 07:31:47 +00:00
|
|
|
"bindings": {
|
|
|
|
"i": ["vim::PushOperator", { "Object": { "around": false } }],
|
2022-10-09 04:20:47 +00:00
|
|
|
"a": ["vim::PushOperator", { "Object": { "around": true } }],
|
2022-04-21 20:33:39 +00:00
|
|
|
"h": "vim::Left",
|
2023-06-21 20:02:32 +00:00
|
|
|
"left": "vim::Left",
|
2022-10-09 04:20:47 +00:00
|
|
|
"backspace": "vim::Backspace",
|
2022-04-21 20:33:39 +00:00
|
|
|
"j": "vim::Down",
|
2023-06-21 20:02:32 +00:00
|
|
|
"down": "vim::Down",
|
2024-07-19 09:52:37 +00:00
|
|
|
"ctrl-j": "vim::Down",
|
2022-04-22 16:43:15 +00:00
|
|
|
"enter": "vim::NextLineStart",
|
2024-07-10 14:31:54 +00:00
|
|
|
"ctrl-m": "vim::NextLineStart",
|
2024-07-11 22:36:07 +00:00
|
|
|
"+": "vim::NextLineStart",
|
|
|
|
"-": "vim::PreviousLineStart",
|
2023-07-19 16:24:23 +00:00
|
|
|
"tab": "vim::Tab",
|
|
|
|
"shift-tab": "vim::Tab",
|
2022-04-21 20:33:39 +00:00
|
|
|
"k": "vim::Up",
|
2023-06-21 20:02:32 +00:00
|
|
|
"up": "vim::Up",
|
2022-04-21 20:33:39 +00:00
|
|
|
"l": "vim::Right",
|
2023-06-21 20:02:32 +00:00
|
|
|
"right": "vim::Right",
|
2024-01-30 09:47:39 +00:00
|
|
|
"space": "vim::Space",
|
2022-04-22 16:43:15 +00:00
|
|
|
"$": "vim::EndOfLine",
|
2024-06-15 04:38:50 +00:00
|
|
|
"end": "vim::EndOfLine",
|
2023-07-03 18:55:41 +00:00
|
|
|
"^": "vim::FirstNonWhitespace",
|
2023-09-11 19:07:11 +00:00
|
|
|
"_": "vim::StartOfLineDownward",
|
|
|
|
"g _": "vim::EndOfLineDownward",
|
2022-04-22 16:43:15 +00:00
|
|
|
"shift-g": "vim::EndOfDocument",
|
2023-06-30 04:45:54 +00:00
|
|
|
"{": "vim::StartOfParagraph",
|
|
|
|
"}": "vim::EndOfParagraph",
|
2023-10-23 04:04:55 +00:00
|
|
|
"|": "vim::GoToColumn",
|
2024-03-08 02:36:12 +00:00
|
|
|
// Word motions
|
|
|
|
"w": "vim::NextWordStart",
|
|
|
|
"e": "vim::NextWordEnd",
|
|
|
|
"b": "vim::PreviousWordStart",
|
|
|
|
"g e": "vim::PreviousWordEnd",
|
|
|
|
// Subword motions
|
|
|
|
// "w": "vim::NextSubwordStart",
|
|
|
|
// "b": "vim::PreviousSubwordStart",
|
|
|
|
// "e": "vim::NextSubwordEnd",
|
|
|
|
// "g e": "vim::PreviousSubwordEnd",
|
2023-02-27 18:23:30 +00:00
|
|
|
"shift-w": ["vim::NextWordStart", { "ignorePunctuation": true }],
|
2022-04-22 16:43:15 +00:00
|
|
|
"shift-e": ["vim::NextWordEnd", { "ignorePunctuation": true }],
|
|
|
|
"shift-b": ["vim::PreviousWordStart", { "ignorePunctuation": true }],
|
2024-06-28 03:54:03 +00:00
|
|
|
"g shift-e": ["vim::PreviousWordEnd", { "ignorePunctuation": true }],
|
2024-04-08 21:20:14 +00:00
|
|
|
"/": "vim::Search",
|
2024-06-07 22:45:38 +00:00
|
|
|
"g /": "pane::DeploySearch",
|
2024-04-08 21:20:14 +00:00
|
|
|
"?": ["vim::Search", { "backwards": true }],
|
|
|
|
"*": "vim::MoveToNext",
|
|
|
|
"#": "vim::MoveToPrev",
|
|
|
|
"n": "vim::MoveToNextMatch",
|
|
|
|
"shift-n": "vim::MoveToPrevMatch",
|
2022-07-27 07:31:47 +00:00
|
|
|
"%": "vim::Matching",
|
2022-05-23 16:23:25 +00:00
|
|
|
"f": ["vim::PushOperator", { "FindForward": { "before": false } }],
|
2022-12-08 00:39:32 +00:00
|
|
|
"t": ["vim::PushOperator", { "FindForward": { "before": true } }],
|
2022-10-06 03:19:30 +00:00
|
|
|
"shift-f": ["vim::PushOperator", { "FindBackward": { "after": false } }],
|
2023-01-09 23:44:40 +00:00
|
|
|
"shift-t": ["vim::PushOperator", { "FindBackward": { "after": true } }],
|
2024-07-03 15:03:39 +00:00
|
|
|
"m": ["vim::PushOperator", "Mark"],
|
2024-06-28 03:54:03 +00:00
|
|
|
"'": ["vim::PushOperator", { "Jump": { "line": true } }],
|
|
|
|
"`": ["vim::PushOperator", { "Jump": { "line": false } }],
|
2024-02-01 17:13:30 +00:00
|
|
|
";": "vim::RepeatFind",
|
|
|
|
",": "vim::RepeatFindReversed",
|
2023-06-21 20:34:35 +00:00
|
|
|
"ctrl-o": "pane::GoBack",
|
2023-09-28 03:04:13 +00:00
|
|
|
"ctrl-i": "pane::GoForward",
|
2023-06-21 20:34:35 +00:00
|
|
|
"ctrl-]": "editor::GoToDefinition",
|
2024-07-03 15:03:39 +00:00
|
|
|
"escape": ["vim::SwitchMode", "Normal"],
|
|
|
|
"ctrl-[": ["vim::SwitchMode", "Normal"],
|
2023-07-28 03:39:37 +00:00
|
|
|
"v": "vim::ToggleVisual",
|
|
|
|
"shift-v": "vim::ToggleVisualLine",
|
2023-08-15 19:26:04 +00:00
|
|
|
"ctrl-v": "vim::ToggleVisualBlock",
|
2023-08-18 17:39:48 +00:00
|
|
|
"ctrl-q": "vim::ToggleVisualBlock",
|
2024-05-06 22:05:19 +00:00
|
|
|
"shift-k": "editor::Hover",
|
2024-03-15 02:31:53 +00:00
|
|
|
"shift-r": "vim::ToggleReplace",
|
2024-06-15 04:38:50 +00:00
|
|
|
"0": "vim::StartOfLine",
|
|
|
|
"home": "vim::StartOfLine",
|
2023-08-17 21:58:10 +00:00
|
|
|
"ctrl-f": "vim::PageDown",
|
|
|
|
"pagedown": "vim::PageDown",
|
|
|
|
"ctrl-b": "vim::PageUp",
|
|
|
|
"pageup": "vim::PageUp",
|
|
|
|
"ctrl-d": "vim::ScrollDown",
|
|
|
|
"ctrl-u": "vim::ScrollUp",
|
|
|
|
"ctrl-e": "vim::LineDown",
|
|
|
|
"ctrl-y": "vim::LineUp",
|
2023-07-20 00:54:29 +00:00
|
|
|
// "g" commands
|
|
|
|
"g g": "vim::StartOfDocument",
|
|
|
|
"g h": "editor::Hover",
|
|
|
|
"g t": "pane::ActivateNextItem",
|
|
|
|
"g shift-t": "pane::ActivatePrevItem",
|
|
|
|
"g d": "editor::GoToDefinition",
|
2024-08-06 09:20:51 +00:00
|
|
|
"g shift-d": "editor::GoToDeclaration",
|
|
|
|
"g y": "editor::GoToTypeDefinition",
|
|
|
|
"g shift-i": "editor::GoToImplementation",
|
2024-02-18 17:52:50 +00:00
|
|
|
"g x": "editor::OpenUrl",
|
2024-04-06 02:23:37 +00:00
|
|
|
"g n": "vim::SelectNextMatch",
|
|
|
|
"g shift-n": "vim::SelectPreviousMatch",
|
|
|
|
"g l": "vim::SelectNext",
|
|
|
|
"g shift-l": "vim::SelectPrevious",
|
2023-09-25 21:23:14 +00:00
|
|
|
"g >": ["editor::SelectNext", { "replace_newest": true }],
|
|
|
|
"g <": ["editor::SelectPrevious", { "replace_newest": true }],
|
|
|
|
"g a": "editor::SelectAllMatches",
|
2023-09-14 19:49:02 +00:00
|
|
|
"g s": "outline::Toggle",
|
|
|
|
"g shift-s": "project_symbols::Toggle",
|
2023-07-20 15:08:07 +00:00
|
|
|
"g .": "editor::ToggleCodeActions", // zed specific
|
|
|
|
"g shift-a": "editor::FindAllReferences", // zed specific
|
2023-09-28 03:05:58 +00:00
|
|
|
"g space": "editor::OpenExcerpts", // zed specific
|
2023-07-20 00:54:29 +00:00
|
|
|
"g *": ["vim::MoveToNext", { "partialWord": true }],
|
|
|
|
"g #": ["vim::MoveToPrev", { "partialWord": true }],
|
vim: Fix relative line motion
Before this change up and down were in display co-ordinates, after this
change they are in fold coordinates (which matches the vim behaviour).
To make this work without causing usabliity problems, a bunch of extra
keyboard shortcuts now work:
- vim: `z {o,c}` to open,close a fold
- vim: `z f` to fold current visual selection
- vim: `g {j,k,up,down}` to move up/down a display line
- vim: `g {0,^,$,home,end}` to get to start/end of a display line
Fixes: zed-industries/community#1562
2023-08-25 04:11:51 +00:00
|
|
|
"g j": ["vim::Down", { "displayLines": true }],
|
|
|
|
"g down": ["vim::Down", { "displayLines": true }],
|
|
|
|
"g k": ["vim::Up", { "displayLines": true }],
|
|
|
|
"g up": ["vim::Up", { "displayLines": true }],
|
|
|
|
"g $": ["vim::EndOfLine", { "displayLines": true }],
|
|
|
|
"g end": ["vim::EndOfLine", { "displayLines": true }],
|
|
|
|
"g 0": ["vim::StartOfLine", { "displayLines": true }],
|
|
|
|
"g home": ["vim::StartOfLine", { "displayLines": true }],
|
|
|
|
"g ^": ["vim::FirstNonWhitespace", { "displayLines": true }],
|
2024-06-14 16:16:59 +00:00
|
|
|
"g v": "vim::RestoreVisualSelection",
|
2024-04-12 06:05:38 +00:00
|
|
|
"g ]": "editor::GoToDiagnostic",
|
|
|
|
"g [": "editor::GoToPrevDiagnostic",
|
2024-06-14 16:16:59 +00:00
|
|
|
"g i": "vim::InsertAtPrevious",
|
2024-05-10 03:18:56 +00:00
|
|
|
"g ,": "vim::ChangeListNewer",
|
|
|
|
"g ;": "vim::ChangeListOlder",
|
2024-01-31 19:13:35 +00:00
|
|
|
"shift-h": "vim::WindowTop",
|
|
|
|
"shift-m": "vim::WindowMiddle",
|
|
|
|
"shift-l": "vim::WindowBottom",
|
2023-07-20 00:54:29 +00:00
|
|
|
// z commands
|
|
|
|
"z t": "editor::ScrollCursorTop",
|
|
|
|
"z z": "editor::ScrollCursorCenter",
|
2024-07-03 15:03:39 +00:00
|
|
|
"z .": ["workspace::SendKeystrokes", "z z ^"],
|
2023-07-20 00:54:29 +00:00
|
|
|
"z b": "editor::ScrollCursorBottom",
|
vim: Fix relative line motion
Before this change up and down were in display co-ordinates, after this
change they are in fold coordinates (which matches the vim behaviour).
To make this work without causing usabliity problems, a bunch of extra
keyboard shortcuts now work:
- vim: `z {o,c}` to open,close a fold
- vim: `z f` to fold current visual selection
- vim: `g {j,k,up,down}` to move up/down a display line
- vim: `g {0,^,$,home,end}` to get to start/end of a display line
Fixes: zed-industries/community#1562
2023-08-25 04:11:51 +00:00
|
|
|
"z c": "editor::Fold",
|
|
|
|
"z o": "editor::UnfoldLines",
|
|
|
|
"z f": "editor::FoldSelectedRanges",
|
2023-09-08 19:55:13 +00:00
|
|
|
"shift-z shift-q": ["pane::CloseActiveItem", { "saveIntent": "skip" }],
|
|
|
|
"shift-z shift-z": ["pane::CloseActiveItem", { "saveIntent": "saveAll" }],
|
2023-07-20 00:54:29 +00:00
|
|
|
// Count support
|
2024-07-03 15:03:39 +00:00
|
|
|
"1": ["vim::Number", 1],
|
|
|
|
"2": ["vim::Number", 2],
|
|
|
|
"3": ["vim::Number", 3],
|
|
|
|
"4": ["vim::Number", 4],
|
|
|
|
"5": ["vim::Number", 5],
|
|
|
|
"6": ["vim::Number", 6],
|
|
|
|
"7": ["vim::Number", 7],
|
|
|
|
"8": ["vim::Number", 8],
|
|
|
|
"9": ["vim::Number", 9],
|
vim: Add support for ctrl-w commands
Primarily {h,j,k,l,left,right,up,down} for moving to a pane by
direction; but also {w,W,p} for going forward/back, and {v,s} for
splitting a pane vertically/horizontally, and {c,q} to close a pane.
There are a large number of ctrl-w commands that are not supported, and
which fall into three buckets:
* switch this pane with that one (VScode also has this, and it's a
requested feature)
* move to top/bottom/leftmost/rightmost
* counts on any of these
* jump to "definition/file-under-cursor/etc.etc." in a new pane.
2023-07-20 00:29:13 +00:00
|
|
|
// window related commands (ctrl-w X)
|
2024-07-09 04:36:21 +00:00
|
|
|
"ctrl-w": null,
|
2024-07-03 15:03:39 +00:00
|
|
|
"ctrl-w left": ["workspace::ActivatePaneInDirection", "Left"],
|
|
|
|
"ctrl-w right": ["workspace::ActivatePaneInDirection", "Right"],
|
|
|
|
"ctrl-w up": ["workspace::ActivatePaneInDirection", "Up"],
|
|
|
|
"ctrl-w down": ["workspace::ActivatePaneInDirection", "Down"],
|
|
|
|
"ctrl-w h": ["workspace::ActivatePaneInDirection", "Left"],
|
|
|
|
"ctrl-w l": ["workspace::ActivatePaneInDirection", "Right"],
|
|
|
|
"ctrl-w k": ["workspace::ActivatePaneInDirection", "Up"],
|
|
|
|
"ctrl-w j": ["workspace::ActivatePaneInDirection", "Down"],
|
|
|
|
"ctrl-w ctrl-h": ["workspace::ActivatePaneInDirection", "Left"],
|
|
|
|
"ctrl-w ctrl-l": ["workspace::ActivatePaneInDirection", "Right"],
|
|
|
|
"ctrl-w ctrl-k": ["workspace::ActivatePaneInDirection", "Up"],
|
|
|
|
"ctrl-w ctrl-j": ["workspace::ActivatePaneInDirection", "Down"],
|
|
|
|
"ctrl-w shift-left": ["workspace::SwapPaneInDirection", "Left"],
|
|
|
|
"ctrl-w shift-right": ["workspace::SwapPaneInDirection", "Right"],
|
|
|
|
"ctrl-w shift-up": ["workspace::SwapPaneInDirection", "Up"],
|
|
|
|
"ctrl-w shift-down": ["workspace::SwapPaneInDirection", "Down"],
|
|
|
|
"ctrl-w shift-h": ["workspace::SwapPaneInDirection", "Left"],
|
|
|
|
"ctrl-w shift-l": ["workspace::SwapPaneInDirection", "Right"],
|
|
|
|
"ctrl-w shift-k": ["workspace::SwapPaneInDirection", "Up"],
|
|
|
|
"ctrl-w shift-j": ["workspace::SwapPaneInDirection", "Down"],
|
vim: Add support for ctrl-w commands
Primarily {h,j,k,l,left,right,up,down} for moving to a pane by
direction; but also {w,W,p} for going forward/back, and {v,s} for
splitting a pane vertically/horizontally, and {c,q} to close a pane.
There are a large number of ctrl-w commands that are not supported, and
which fall into three buckets:
* switch this pane with that one (VScode also has this, and it's a
requested feature)
* move to top/bottom/leftmost/rightmost
* counts on any of these
* jump to "definition/file-under-cursor/etc.etc." in a new pane.
2023-07-20 00:29:13 +00:00
|
|
|
"ctrl-w g t": "pane::ActivateNextItem",
|
|
|
|
"ctrl-w ctrl-g t": "pane::ActivateNextItem",
|
|
|
|
"ctrl-w g shift-t": "pane::ActivatePrevItem",
|
|
|
|
"ctrl-w ctrl-g shift-t": "pane::ActivatePrevItem",
|
|
|
|
"ctrl-w w": "workspace::ActivateNextPane",
|
|
|
|
"ctrl-w ctrl-w": "workspace::ActivateNextPane",
|
|
|
|
"ctrl-w p": "workspace::ActivatePreviousPane",
|
|
|
|
"ctrl-w ctrl-p": "workspace::ActivatePreviousPane",
|
|
|
|
"ctrl-w shift-w": "workspace::ActivatePreviousPane",
|
|
|
|
"ctrl-w ctrl-shift-w": "workspace::ActivatePreviousPane",
|
|
|
|
"ctrl-w v": "pane::SplitLeft",
|
|
|
|
"ctrl-w ctrl-v": "pane::SplitLeft",
|
|
|
|
"ctrl-w s": "pane::SplitUp",
|
|
|
|
"ctrl-w shift-s": "pane::SplitUp",
|
|
|
|
"ctrl-w ctrl-s": "pane::SplitUp",
|
|
|
|
"ctrl-w c": "pane::CloseAllItems",
|
|
|
|
"ctrl-w ctrl-c": "pane::CloseAllItems",
|
|
|
|
"ctrl-w q": "pane::CloseAllItems",
|
2023-09-20 21:00:41 +00:00
|
|
|
"ctrl-w ctrl-q": "pane::CloseAllItems",
|
|
|
|
"ctrl-w o": "workspace::CloseInactiveTabsAndPanes",
|
|
|
|
"ctrl-w ctrl-o": "workspace::CloseInactiveTabsAndPanes",
|
2024-07-03 15:03:39 +00:00
|
|
|
"ctrl-w n": ["workspace::NewFileInDirection", "Up"],
|
|
|
|
"ctrl-w ctrl-n": ["workspace::NewFileInDirection", "Up"],
|
2024-02-29 09:06:17 +00:00
|
|
|
"ctrl-w d": "editor::GoToDefinitionSplit",
|
|
|
|
"ctrl-w g d": "editor::GoToDefinitionSplit",
|
|
|
|
"ctrl-w shift-d": "editor::GoToTypeDefinitionSplit",
|
|
|
|
"ctrl-w g shift-d": "editor::GoToTypeDefinitionSplit",
|
2024-02-29 02:23:36 +00:00
|
|
|
"ctrl-w space": "editor::OpenExcerptsSplit",
|
|
|
|
"ctrl-w g space": "editor::OpenExcerptsSplit",
|
2024-07-11 19:16:26 +00:00
|
|
|
"ctrl-6": "pane::AlternateFile"
|
2023-04-20 11:08:30 +00:00
|
|
|
}
|
2022-05-03 17:29:57 +00:00
|
|
|
},
|
2022-04-22 16:43:15 +00:00
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_mode == normal",
|
2022-04-22 16:43:15 +00:00
|
|
|
"bindings": {
|
2024-07-11 19:16:26 +00:00
|
|
|
"escape": "editor::Cancel",
|
|
|
|
"ctrl-[": "editor::Cancel",
|
2024-08-08 20:47:27 +00:00
|
|
|
":": "command_palette::Toggle",
|
2023-08-21 22:10:13 +00:00
|
|
|
".": "vim::Repeat",
|
2024-07-03 15:03:39 +00:00
|
|
|
"c": ["vim::PushOperator", "Change"],
|
2022-07-27 07:31:47 +00:00
|
|
|
"shift-c": "vim::ChangeToEndOfLine",
|
2024-07-03 15:03:39 +00:00
|
|
|
"d": ["vim::PushOperator", "Delete"],
|
2022-07-27 07:31:47 +00:00
|
|
|
"shift-d": "vim::DeleteToEndOfLine",
|
2023-09-07 16:51:18 +00:00
|
|
|
"shift-j": "vim::JoinLines",
|
2024-07-03 15:03:39 +00:00
|
|
|
"y": ["vim::PushOperator", "Yank"],
|
2024-07-19 04:34:40 +00:00
|
|
|
"shift-y": "vim::YankToEndOfLine",
|
2023-08-21 22:10:13 +00:00
|
|
|
"i": "vim::InsertBefore",
|
2022-04-22 16:43:15 +00:00
|
|
|
"shift-i": "vim::InsertFirstNonWhitespace",
|
|
|
|
"a": "vim::InsertAfter",
|
2022-07-27 07:31:47 +00:00
|
|
|
"shift-a": "vim::InsertEndOfLine",
|
2022-04-22 16:43:15 +00:00
|
|
|
"x": "vim::DeleteRight",
|
|
|
|
"shift-x": "vim::DeleteLeft",
|
|
|
|
"o": "vim::InsertLineBelow",
|
2022-07-27 07:31:47 +00:00
|
|
|
"shift-o": "vim::InsertLineAbove",
|
2023-06-27 02:19:28 +00:00
|
|
|
"~": "vim::ChangeCase",
|
2023-09-27 18:32:01 +00:00
|
|
|
"ctrl-a": "vim::Increment",
|
|
|
|
"ctrl-x": "vim::Decrement",
|
2022-05-23 16:23:25 +00:00
|
|
|
"p": "vim::Paste",
|
2023-08-21 18:55:59 +00:00
|
|
|
"shift-p": ["vim::Paste", { "before": true }],
|
2024-07-09 05:16:52 +00:00
|
|
|
"u": "vim::Undo",
|
|
|
|
"ctrl-r": "vim::Redo",
|
2024-07-03 15:03:39 +00:00
|
|
|
"r": ["vim::PushOperator", "Replace"],
|
2023-06-26 20:42:47 +00:00
|
|
|
"s": "vim::Substitute",
|
2023-09-01 18:23:45 +00:00
|
|
|
"shift-s": "vim::SubstituteLine",
|
2024-07-03 15:03:39 +00:00
|
|
|
">": ["vim::PushOperator", "Indent"],
|
|
|
|
"<": ["vim::PushOperator", "Outdent"],
|
|
|
|
"g u": ["vim::PushOperator", "Lowercase"],
|
|
|
|
"g shift-u": ["vim::PushOperator", "Uppercase"],
|
|
|
|
"g ~": ["vim::PushOperator", "OppositeCase"],
|
|
|
|
"\"": ["vim::PushOperator", "Register"],
|
|
|
|
"q": "vim::ToggleRecord",
|
|
|
|
"shift-q": "vim::ReplayLastRecording",
|
|
|
|
"@": ["vim::PushOperator", "ReplayRegister"],
|
2023-06-26 20:42:47 +00:00
|
|
|
"ctrl-pagedown": "pane::ActivateNextItem",
|
2024-03-07 05:53:17 +00:00
|
|
|
"ctrl-pageup": "pane::ActivatePrevItem",
|
2024-04-12 06:05:38 +00:00
|
|
|
// tree-sitter related commands
|
|
|
|
"[ x": "editor::SelectLargerSyntaxNode",
|
2024-05-24 03:09:32 +00:00
|
|
|
"] x": "editor::SelectSmallerSyntaxNode",
|
|
|
|
"] d": "editor::GoToDiagnostic",
|
|
|
|
"[ d": "editor::GoToPrevDiagnostic",
|
|
|
|
"] c": "editor::GoToHunk",
|
2024-07-11 19:16:26 +00:00
|
|
|
"[ c": "editor::GoToPrevHunk",
|
2024-07-23 03:22:10 +00:00
|
|
|
"g c": ["vim::PushOperator", "ToggleComments"]
|
2024-04-12 06:05:38 +00:00
|
|
|
}
|
|
|
|
},
|
2024-08-08 20:47:27 +00:00
|
|
|
{
|
|
|
|
"context": "VimControl && VimCount",
|
|
|
|
"bindings": {
|
|
|
|
"0": ["vim::Number", 0],
|
|
|
|
":": "vim::CountCommand"
|
|
|
|
}
|
|
|
|
},
|
2024-04-12 06:05:38 +00:00
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_mode == visual",
|
2024-04-12 06:05:38 +00:00
|
|
|
"bindings": {
|
2024-08-08 20:47:27 +00:00
|
|
|
":": "vim::VisualCommand",
|
2024-07-11 19:16:26 +00:00
|
|
|
"u": "vim::ConvertToLowerCase",
|
|
|
|
"U": "vim::ConvertToUpperCase",
|
|
|
|
"o": "vim::OtherEnd",
|
|
|
|
"shift-o": "vim::OtherEnd",
|
|
|
|
"d": "vim::VisualDelete",
|
|
|
|
"x": "vim::VisualDelete",
|
|
|
|
"shift-d": "vim::VisualDeleteLine",
|
|
|
|
"shift-x": "vim::VisualDeleteLine",
|
|
|
|
"y": "vim::VisualYank",
|
|
|
|
"shift-y": "vim::VisualYank",
|
|
|
|
"p": "vim::Paste",
|
|
|
|
"shift-p": ["vim::Paste", { "preserveClipboard": true }],
|
|
|
|
"s": "vim::Substitute",
|
|
|
|
"shift-s": "vim::SubstituteLine",
|
|
|
|
"shift-r": "vim::SubstituteLine",
|
|
|
|
"c": "vim::Substitute",
|
|
|
|
"~": "vim::ChangeCase",
|
|
|
|
"*": ["vim::MoveToNext", { "partialWord": true }],
|
|
|
|
"#": ["vim::MoveToPrev", { "partialWord": true }],
|
|
|
|
"ctrl-a": "vim::Increment",
|
|
|
|
"ctrl-x": "vim::Decrement",
|
|
|
|
"g ctrl-a": ["vim::Increment", { "step": true }],
|
|
|
|
"g ctrl-x": ["vim::Decrement", { "step": true }],
|
|
|
|
"shift-i": "vim::InsertBefore",
|
|
|
|
"shift-a": "vim::InsertAfter",
|
|
|
|
"shift-j": "vim::JoinLines",
|
|
|
|
"r": ["vim::PushOperator", "Replace"],
|
|
|
|
"ctrl-c": ["vim::SwitchMode", "Normal"],
|
|
|
|
"escape": ["vim::SwitchMode", "Normal"],
|
|
|
|
"ctrl-[": ["vim::SwitchMode", "Normal"],
|
|
|
|
">": "vim::Indent",
|
|
|
|
"<": "vim::Outdent",
|
|
|
|
"i": ["vim::PushOperator", { "Object": { "around": false } }],
|
|
|
|
"a": ["vim::PushOperator", { "Object": { "around": true } }],
|
|
|
|
"g c": "vim::ToggleComments",
|
2024-07-03 15:03:39 +00:00
|
|
|
"\"": ["vim::PushOperator", "Register"],
|
2024-04-12 06:05:38 +00:00
|
|
|
// tree-sitter related commands
|
2024-03-07 05:53:17 +00:00
|
|
|
"[ x": "editor::SelectLargerSyntaxNode",
|
|
|
|
"] x": "editor::SelectSmallerSyntaxNode"
|
2023-04-20 11:08:30 +00:00
|
|
|
}
|
2023-01-06 22:03:01 +00:00
|
|
|
},
|
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_mode == insert",
|
2023-01-06 22:03:01 +00:00
|
|
|
"bindings": {
|
2024-07-11 19:16:26 +00:00
|
|
|
"escape": "vim::NormalBefore",
|
|
|
|
"ctrl-c": "vim::NormalBefore",
|
|
|
|
"ctrl-[": "vim::NormalBefore",
|
|
|
|
"ctrl-x": null,
|
|
|
|
"ctrl-x ctrl-o": "editor::ShowCompletions",
|
|
|
|
"ctrl-x ctrl-a": "assistant::InlineAssist", // zed specific
|
|
|
|
"ctrl-x ctrl-c": "editor::ShowInlineCompletion", // zed specific
|
|
|
|
"ctrl-x ctrl-l": "editor::ToggleCodeActions", // zed specific
|
|
|
|
"ctrl-x ctrl-z": "editor::Cancel",
|
|
|
|
"ctrl-w": "editor::DeleteToPreviousWordStart",
|
|
|
|
"ctrl-u": "editor::DeleteToBeginningOfLine",
|
|
|
|
"ctrl-t": "vim::Indent",
|
|
|
|
"ctrl-d": "vim::Outdent",
|
2024-07-29 04:44:32 +00:00
|
|
|
"ctrl-k": ["vim::PushOperator", { "Digraph": {} }],
|
2024-07-11 19:16:26 +00:00
|
|
|
"ctrl-r": ["vim::PushOperator", "Register"]
|
Add surrounds support for vim (#9400)
For #4965
There are still some minor issues:
1. When change the surround and delete the surround, we should also
decide whether there are spaces inside after deleting/replacing
according to whether it is open parentheses, and replace them
accordingly, but at present, delete and change, haven't done this
adaptation for current pr, I'm not sure if I can fit it in the back or
if it needs to be fitted together.
2. In the selection mode, pressing s plus brackets should also trigger
the Add Surrounds function, but this MR has not adapted the selection
mode for the time being, I think we need to support different add
behaviors for the three selection modes.(Currently in select mode, s is
used for Substitute)
3. For the current change surrounds, if the user does not find the
bracket that needs to be matched after entering cs, but it is a valid
bracket, and will wait for the second input before failing, the better
practice here should be to return to normal mode if the first bracket is
not found
4. I reused BracketPair in language, but two of its properties weren't
used in this mr, so I'm not sure if I should create a new struct with
only start and end, which would have less code
I'm not sure which ones need to be changed in the first issue, and which
ones can be revised in the future, and it seems that they can be solved
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-04-08 17:41:06 +00:00
|
|
|
}
|
|
|
|
},
|
2024-04-30 01:38:14 +00:00
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_mode == replace",
|
2024-04-30 01:38:14 +00:00
|
|
|
"bindings": {
|
2024-07-11 19:16:26 +00:00
|
|
|
"escape": "vim::NormalBefore",
|
|
|
|
"ctrl-c": "vim::NormalBefore",
|
|
|
|
"ctrl-[": "vim::NormalBefore",
|
2024-07-29 04:44:32 +00:00
|
|
|
"ctrl-k": ["vim::PushOperator", { "Digraph": {} }],
|
2024-07-11 19:16:26 +00:00
|
|
|
"backspace": "vim::UndoReplace",
|
|
|
|
"tab": "vim::Tab",
|
|
|
|
"enter": "vim::Enter"
|
2024-04-30 01:38:14 +00:00
|
|
|
}
|
|
|
|
},
|
2024-06-04 21:17:01 +00:00
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_mode == waiting",
|
2024-06-04 21:17:01 +00:00
|
|
|
"bindings": {
|
2024-07-11 19:16:26 +00:00
|
|
|
"tab": "vim::Tab",
|
2024-07-16 20:08:05 +00:00
|
|
|
"enter": "vim::Enter",
|
|
|
|
"escape": "vim::ClearOperators",
|
|
|
|
"ctrl-c": "vim::ClearOperators",
|
2024-07-29 04:44:32 +00:00
|
|
|
"ctrl-[": "vim::ClearOperators",
|
|
|
|
"ctrl-k": ["vim::PushOperator", { "Digraph": {} }]
|
2024-06-04 21:17:01 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_mode == operator",
|
2024-06-04 21:17:01 +00:00
|
|
|
"bindings": {
|
2024-07-11 19:16:26 +00:00
|
|
|
"escape": "vim::ClearOperators",
|
|
|
|
"ctrl-c": "vim::ClearOperators",
|
|
|
|
"ctrl-[": "vim::ClearOperators"
|
2024-06-04 21:17:01 +00:00
|
|
|
}
|
|
|
|
},
|
2023-04-20 11:08:30 +00:00
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_operator == a || vim_operator == i || vim_operator == cs",
|
2022-10-06 03:19:30 +00:00
|
|
|
"bindings": {
|
|
|
|
"w": "vim::Word",
|
2023-02-08 23:01:42 +00:00
|
|
|
"shift-w": ["vim::Word", { "ignorePunctuation": true }],
|
2024-02-27 05:48:19 +00:00
|
|
|
"t": "vim::Tag",
|
2022-10-11 22:17:29 +00:00
|
|
|
"s": "vim::Sentence",
|
2024-03-04 23:39:02 +00:00
|
|
|
"p": "vim::Paragraph",
|
2022-10-11 22:17:29 +00:00
|
|
|
"'": "vim::Quotes",
|
|
|
|
"`": "vim::BackQuotes",
|
|
|
|
"\"": "vim::DoubleQuotes",
|
2023-10-23 04:04:55 +00:00
|
|
|
"|": "vim::VerticalBars",
|
2022-10-11 22:17:29 +00:00
|
|
|
"(": "vim::Parentheses",
|
|
|
|
")": "vim::Parentheses",
|
2023-10-23 04:04:55 +00:00
|
|
|
"b": "vim::Parentheses",
|
2022-10-11 22:17:29 +00:00
|
|
|
"[": "vim::SquareBrackets",
|
|
|
|
"]": "vim::SquareBrackets",
|
|
|
|
"{": "vim::CurlyBrackets",
|
|
|
|
"}": "vim::CurlyBrackets",
|
2023-10-23 04:04:55 +00:00
|
|
|
"shift-b": "vim::CurlyBrackets",
|
2022-10-11 22:17:29 +00:00
|
|
|
"<": "vim::AngleBrackets",
|
2024-02-24 02:37:13 +00:00
|
|
|
">": "vim::AngleBrackets",
|
|
|
|
"a": "vim::Argument"
|
2023-04-20 11:08:30 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_operator == c",
|
2022-05-03 17:29:57 +00:00
|
|
|
"bindings": {
|
2024-07-11 19:16:26 +00:00
|
|
|
"c": "vim::CurrentLine",
|
|
|
|
"d": "editor::Rename", // zed specific
|
|
|
|
"s": ["vim::PushOperator", { "ChangeSurrounds": {} }]
|
2023-04-20 11:08:30 +00:00
|
|
|
}
|
|
|
|
},
|
2024-04-12 06:05:38 +00:00
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_operator == d",
|
2024-04-12 06:05:38 +00:00
|
|
|
"bindings": {
|
2024-07-11 19:16:26 +00:00
|
|
|
"d": "vim::CurrentLine",
|
|
|
|
"s": ["vim::PushOperator", "DeleteSurrounds"]
|
2024-04-12 06:05:38 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_operator == gu",
|
2024-04-12 06:05:38 +00:00
|
|
|
"bindings": {
|
2024-07-11 19:16:26 +00:00
|
|
|
"g u": "vim::CurrentLine",
|
|
|
|
"u": "vim::CurrentLine"
|
2024-04-12 06:05:38 +00:00
|
|
|
}
|
|
|
|
},
|
2023-04-20 11:08:30 +00:00
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_operator == gU",
|
2022-05-03 17:29:57 +00:00
|
|
|
"bindings": {
|
2024-07-11 19:16:26 +00:00
|
|
|
"g shift-u": "vim::CurrentLine",
|
|
|
|
"shift-u": "vim::CurrentLine"
|
2023-04-20 11:08:30 +00:00
|
|
|
}
|
|
|
|
},
|
2024-03-15 02:31:53 +00:00
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_operator == g~",
|
2024-03-15 02:31:53 +00:00
|
|
|
"bindings": {
|
2024-07-11 19:16:26 +00:00
|
|
|
"g ~": "vim::CurrentLine",
|
|
|
|
"~": "vim::CurrentLine"
|
2024-03-15 02:31:53 +00:00
|
|
|
}
|
|
|
|
},
|
2023-04-20 11:08:30 +00:00
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_operator == y",
|
2022-05-03 17:29:57 +00:00
|
|
|
"bindings": {
|
2024-07-11 19:16:26 +00:00
|
|
|
"y": "vim::CurrentLine",
|
|
|
|
"s": ["vim::PushOperator", { "AddSurrounds": {} }]
|
2022-04-11 22:54:52 +00:00
|
|
|
}
|
2023-06-28 18:48:15 +00:00
|
|
|
},
|
2024-06-18 04:17:33 +00:00
|
|
|
{
|
2024-07-11 19:16:26 +00:00
|
|
|
"context": "vim_operator == ys",
|
2024-06-18 04:17:33 +00:00
|
|
|
"bindings": {
|
2024-07-11 19:16:26 +00:00
|
|
|
"s": "vim::CurrentLine"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"context": "vim_operator == >",
|
|
|
|
"bindings": {
|
|
|
|
">": "vim::CurrentLine"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"context": "vim_operator == <",
|
|
|
|
"bindings": {
|
|
|
|
"<": "vim::CurrentLine"
|
2024-06-18 04:17:33 +00:00
|
|
|
}
|
|
|
|
},
|
2024-07-23 03:22:10 +00:00
|
|
|
{
|
|
|
|
"context": "vim_operator == gc",
|
|
|
|
"bindings": {
|
|
|
|
"c": "vim::CurrentLine"
|
|
|
|
}
|
|
|
|
},
|
2023-06-28 18:48:15 +00:00
|
|
|
{
|
2024-02-10 23:21:13 +00:00
|
|
|
"context": "BufferSearchBar && !in_replace",
|
2023-06-28 18:48:15 +00:00
|
|
|
"bindings": {
|
2023-07-07 17:33:15 +00:00
|
|
|
"enter": "vim::SearchSubmit",
|
2023-07-06 19:21:01 +00:00
|
|
|
"escape": "buffer_search::Dismiss"
|
2023-06-28 18:48:15 +00:00
|
|
|
}
|
2024-02-14 21:38:07 +00:00
|
|
|
},
|
2024-04-04 20:24:49 +00:00
|
|
|
{
|
|
|
|
"context": "EmptyPane || SharedScreen",
|
|
|
|
"bindings": {
|
2024-06-28 03:54:03 +00:00
|
|
|
":": "command_palette::Toggle",
|
|
|
|
"g /": "pane::DeploySearch"
|
2024-04-04 20:24:49 +00:00
|
|
|
}
|
|
|
|
},
|
2024-02-14 21:38:07 +00:00
|
|
|
{
|
2024-02-17 20:36:08 +00:00
|
|
|
// netrw compatibility
|
2024-02-14 21:38:07 +00:00
|
|
|
"context": "ProjectPanel && not_editing",
|
|
|
|
"bindings": {
|
2024-02-17 20:36:08 +00:00
|
|
|
":": "command_palette::Toggle",
|
2024-02-14 21:38:07 +00:00
|
|
|
"%": "project_panel::NewFile",
|
2024-02-17 20:36:08 +00:00
|
|
|
"/": "project_panel::NewSearchInDirectory",
|
|
|
|
"d": "project_panel::NewDirectory",
|
2024-04-12 20:50:27 +00:00
|
|
|
"enter": "project_panel::OpenPermanent",
|
2024-02-17 20:36:08 +00:00
|
|
|
"escape": "project_panel::ToggleFocus",
|
2024-02-14 21:38:07 +00:00
|
|
|
"h": "project_panel::CollapseSelectedEntry",
|
|
|
|
"j": "menu::SelectNext",
|
|
|
|
"k": "menu::SelectPrev",
|
2024-02-17 20:36:08 +00:00
|
|
|
"l": "project_panel::ExpandSelectedEntry",
|
2024-04-12 20:50:27 +00:00
|
|
|
"o": "project_panel::OpenPermanent",
|
2024-02-14 21:38:07 +00:00
|
|
|
"shift-d": "project_panel::Delete",
|
2024-02-17 20:36:08 +00:00
|
|
|
"shift-r": "project_panel::Rename",
|
2024-04-12 20:50:27 +00:00
|
|
|
"t": "project_panel::OpenPermanent",
|
|
|
|
"v": "project_panel::OpenPermanent",
|
|
|
|
"p": "project_panel::Open",
|
2024-07-09 18:54:14 +00:00
|
|
|
"x": "project_panel::RevealInFileManager",
|
2024-04-26 22:35:57 +00:00
|
|
|
"shift-g": "menu::SelectLast",
|
2024-04-27 00:22:15 +00:00
|
|
|
"g g": "menu::SelectFirst",
|
2024-07-11 19:16:26 +00:00
|
|
|
"-": "project_panel::SelectParent",
|
|
|
|
"ctrl-6": "pane::AlternateFile"
|
2024-02-14 21:38:07 +00:00
|
|
|
}
|
2024-07-03 15:23:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"context": "OutlinePanel",
|
|
|
|
"bindings": {
|
|
|
|
"j": "menu::SelectNext",
|
|
|
|
"k": "menu::SelectPrev",
|
|
|
|
"shift-g": "menu::SelectLast",
|
|
|
|
"g g": "menu::SelectFirst"
|
|
|
|
}
|
2023-04-20 11:08:30 +00:00
|
|
|
}
|
2022-04-21 20:33:39 +00:00
|
|
|
]
|