vim visual block (#2849)

Release notes:

- vim: add Visual Block mode
([#984](https://github.com/zed-industries/community/issues/984)),
([#1415](https://github.com/zed-industries/community/issues/1415)).
- vim: add support for `a<object>` and `i<object>` in visual modes
- vim: fix scroll shortcuts (`ctrl-{f,b,d,u,e,y}`) in visual modes
- allow `shift-enter` to type a newline.
This commit is contained in:
Conrad Irwin
2023-08-18 09:55:40 -06:00
committed by GitHub
28 changed files with 946 additions and 321 deletions
+1
View File
@@ -173,6 +173,7 @@
"context": "Editor && mode == full",
"bindings": {
"enter": "editor::Newline",
"shift-enter": "editor::Newline",
"cmd-shift-enter": "editor::NewlineAbove",
"cmd-enter": "editor::NewlineBelow",
"alt-z": "editor::ToggleSoftWrap",
+32 -10
View File
@@ -103,9 +103,18 @@
],
"v": "vim::ToggleVisual",
"shift-v": "vim::ToggleVisualLine",
"ctrl-v": "vim::ToggleVisualBlock",
"*": "vim::MoveToNext",
"#": "vim::MoveToPrev",
"0": "vim::StartOfLine", // When no number operator present, use start of line motion
"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",
// "g" commands
"g g": "vim::StartOfDocument",
"g h": "editor::Hover",
@@ -293,14 +302,6 @@
"backwards": true
}
],
"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",
"r": [
"vim::PushOperator",
"Replace"
@@ -365,7 +366,7 @@
}
},
{
"context": "Editor && vim_mode == visual && !VimWaiting",
"context": "Editor && vim_mode == visual && !VimWaiting && !VimObject",
"bindings": {
"u": "editor::Undo",
"o": "vim::OtherEnd",
@@ -377,6 +378,11 @@
"s": "vim::Substitute",
"c": "vim::Substitute",
"~": "vim::ChangeCase",
"shift-i": [
"vim::SwitchMode",
"Insert"
],
"shift-a": "vim::InsertAfter",
"r": [
"vim::PushOperator",
"Replace"
@@ -394,7 +400,23 @@
"Normal"
],
">": "editor::Indent",
"<": "editor::Outdent"
"<": "editor::Outdent",
"i": [
"vim::PushOperator",
{
"Object": {
"around": false
}
}
],
"a": [
"vim::PushOperator",
{
"Object": {
"around": true
}
}
],
}
},
{