aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/config/bindings.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-07-09 21:45:22 +0000
committerGitHub <noreply@github.com>2020-07-09 21:45:22 +0000
commit46c0f352c40ecb68653421cb178a297acaf00c6d (patch)
tree3e1985f8237f7c8268703634f8c8ccb25f7823a5 /alacritty/src/config/bindings.rs
parent9974bc8baa45fda0b4ba3db2ae615fb7f90f7029 (diff)
downloadr-alacritty-46c0f352c40ecb68653421cb178a297acaf00c6d.tar.gz
r-alacritty-46c0f352c40ecb68653421cb178a297acaf00c6d.tar.bz2
r-alacritty-46c0f352c40ecb68653421cb178a297acaf00c6d.zip
Add regex scrollback buffer search
This adds a new regex search which allows searching the entire scrollback and jumping between matches using the vi mode. All visible matches should be highlighted unless their lines are excessively long. This should help with performance since highlighting is done during render time. Fixes #1017.
Diffstat (limited to 'alacritty/src/config/bindings.rs')
-rw-r--r--alacritty/src/config/bindings.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/alacritty/src/config/bindings.rs b/alacritty/src/config/bindings.rs
index 547e168c..81a46d66 100644
--- a/alacritty/src/config/bindings.rs
+++ b/alacritty/src/config/bindings.rs
@@ -176,6 +176,12 @@ pub enum Action {
/// Allow receiving char input.
ReceiveChar,
+ /// Start a buffer search.
+ Search,
+
+ /// Start a reverse buffer search.
+ SearchReverse,
+
/// No action.
None,
}
@@ -208,6 +214,14 @@ pub enum ViAction {
ToggleBlockSelection,
/// Toggle semantic vi selection.
ToggleSemanticSelection,
+ /// Jump to the beginning of the next match.
+ SearchNext,
+ /// Jump to the beginning of the previous match.
+ SearchPrevious,
+ /// Jump to the end of the next match.
+ SearchEndNext,
+ /// Jump to the end of the previous match.
+ SearchEndPrevious,
/// Launch the URL below the vi mode cursor.
Open,
}
@@ -364,10 +378,14 @@ pub fn default_key_bindings() -> Vec<KeyBinding> {
D, ModifiersState::CTRL, +TermMode::VI; Action::ScrollHalfPageDown;
Y, +TermMode::VI; Action::Copy;
Y, +TermMode::VI; Action::ClearSelection;
+ Slash, +TermMode::VI; Action::Search;
+ Slash, ModifiersState::SHIFT, +TermMode::VI; Action::SearchReverse;
V, +TermMode::VI; ViAction::ToggleNormalSelection;
V, ModifiersState::SHIFT, +TermMode::VI; ViAction::ToggleLineSelection;
V, ModifiersState::CTRL, +TermMode::VI; ViAction::ToggleBlockSelection;
V, ModifiersState::ALT, +TermMode::VI; ViAction::ToggleSemanticSelection;
+ N, +TermMode::VI; ViAction::SearchNext;
+ N, ModifiersState::SHIFT, +TermMode::VI; ViAction::SearchPrevious;
Return, +TermMode::VI; ViAction::Open;
K, +TermMode::VI; ViMotion::Up;
J, +TermMode::VI; ViMotion::Down;