vim: Allow ctrl+[ as an alias for escape (#2741)

Also remove unneeded mappings in `g` and `z` modes

Release Notes:

- Adds `ctrl+[` as an alias for escape
([#538](https://github.com/zed-industries/community/issues/538)).
This commit is contained in:
Conrad Irwin 2023-07-17 15:07:53 -06:00 committed by GitHub
commit 96abba2b7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,6 +99,10 @@
"vim::SwitchMode",
"Normal"
],
"ctrl+[": [
"vim::SwitchMode",
"Normal"
],
"0": "vim::StartOfLine", // When no number operator present, use start of line motion
"1": [
"vim::Number",
@ -234,10 +238,6 @@
"h": "editor::Hover",
"t": "pane::ActivateNextItem",
"shift-t": "pane::ActivatePrevItem",
"escape": [
"vim::SwitchMode",
"Normal"
],
"d": "editor::GoToDefinition"
}
},
@ -265,10 +265,6 @@
"t": "editor::ScrollCursorTop",
"z": "editor::ScrollCursorCenter",
"b": "editor::ScrollCursorBottom",
"escape": [
"vim::SwitchMode",
"Normal"
]
}
},
{
@ -322,7 +318,8 @@
"context": "Editor && vim_mode == insert",
"bindings": {
"escape": "vim::NormalBefore",
"ctrl-c": "vim::NormalBefore"
"ctrl-c": "vim::NormalBefore",
"ctrl-[": "vim::NormalBefore",
}
},
{
@ -333,6 +330,10 @@
"escape": [
"vim::SwitchMode",
"Normal"
],
"ctrl+[": [
"vim::SwitchMode",
"Normal"
]
}
}