summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-08-09 22:57:55 +0000
committerGitHub <noreply@github.com>2020-08-10 01:57:55 +0300
commit4b516c63654465041604d3e4c816136a902287a4 (patch)
treee32af1d29d4de7f516268fae1d187904f88f67e6
parent576252294d09c1f52ec73bde03652349bdf5a529 (diff)
downloadalacritty-4b516c63654465041604d3e4c816136a902287a4.tar.gz
alacritty-4b516c63654465041604d3e4c816136a902287a4.zip
Add ^C binding to cancel search and leave Vi mode
Fixes #4089.
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty.yml1
-rw-r--r--alacritty/src/config/bindings.rs1
-rw-r--r--alacritty/src/input.rs3
4 files changed, 5 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f3255e2e..0d792622 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Secondary device attributes escape (`CSI > 0 c`)
- Support for colon separated SGR 38/48
+- New Ctrl+C binding to cancel search and leave vi mode
### Changed
diff --git a/alacritty.yml b/alacritty.yml
index da41059a..e1665e66 100644
--- a/alacritty.yml
+++ b/alacritty.yml
@@ -637,6 +637,7 @@
#- { key: Escape, mode: Vi, action: ClearSelection }
#- { key: I, mode: Vi, action: ScrollToBottom }
#- { key: I, mode: Vi, action: ToggleViMode }
+ #- { key: C, mods: Control, mode: Vi, action: ToggleViMode }
#- { key: Y, mods: Control, mode: Vi, action: ScrollLineUp }
#- { key: E, mods: Control, mode: Vi, action: ScrollLineDown }
#- { key: G, mode: Vi, action: ScrollToTop }
diff --git a/alacritty/src/config/bindings.rs b/alacritty/src/config/bindings.rs
index 1c07a33b..74514a5a 100644
--- a/alacritty/src/config/bindings.rs
+++ b/alacritty/src/config/bindings.rs
@@ -368,6 +368,7 @@ pub fn default_key_bindings() -> Vec<KeyBinding> {
Escape, +TermMode::VI; Action::ClearSelection;
I, +TermMode::VI; Action::ScrollToBottom;
I, +TermMode::VI; Action::ToggleViMode;
+ C, ModifiersState::CTRL, +TermMode::VI; Action::ToggleViMode;
Y, ModifiersState::CTRL, +TermMode::VI; Action::ScrollLineUp;
E, ModifiersState::CTRL, +TermMode::VI; Action::ScrollLineDown;
G, +TermMode::VI; Action::ScrollToTop;
diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs
index b6aca62b..44d81217 100644
--- a/alacritty/src/input.rs
+++ b/alacritty/src/input.rs
@@ -832,7 +832,8 @@ impl<'a, T: EventListener, A: ActionContext<T>> Processor<'a, T, A> {
*self.ctx.suppress_chars() = true;
},
- (Some(VirtualKeyCode::Escape), _) => {
+ (Some(VirtualKeyCode::Escape), _)
+ | (Some(VirtualKeyCode::C), ModifiersState::CTRL) => {
self.ctx.cancel_search();
*self.ctx.suppress_chars() = true;
},