diff options
author | Christian Duerr <contact@christianduerr.com> | 2023-10-20 11:33:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-20 13:33:38 +0400 |
commit | 845a5d8a8d47c233c4ed8177ecbb20b05b22118b (patch) | |
tree | 057f4c5974f60defa0c6f79060ef26e59398b1f1 /alacritty/src/config | |
parent | 7ceb638ff80eca99ac63df5fd8cbb2f703d4637a (diff) | |
download | r-alacritty-845a5d8a8d47c233c4ed8177ecbb20b05b22118b.tar.gz r-alacritty-845a5d8a8d47c233c4ed8177ecbb20b05b22118b.tar.bz2 r-alacritty-845a5d8a8d47c233c4ed8177ecbb20b05b22118b.zip |
Add inline vi mode search
This patch adds inline search to vi mode using `f`/`F` and `t`/`T` as
default bindings. The behavior matches that of vim.
Fixes #7203.
Diffstat (limited to 'alacritty/src/config')
-rw-r--r-- | alacritty/src/config/bindings.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/alacritty/src/config/bindings.rs b/alacritty/src/config/bindings.rs index 6e25ac9d..71278fd7 100644 --- a/alacritty/src/config/bindings.rs +++ b/alacritty/src/config/bindings.rs @@ -331,6 +331,18 @@ pub enum ViAction { Open, /// Centers the screen around the vi mode cursor. CenterAroundViCursor, + /// Search forward within the current line. + InlineSearchForward, + /// Search backward within the current line. + InlineSearchBackward, + /// Search forward within the current line, stopping just short of the character. + InlineSearchForwardShort, + /// Search backward within the current line, stopping just short of the character. + InlineSearchBackwardShort, + /// Jump to the next inline search match. + InlineSearchNext, + /// Jump to the previous inline search match. + InlineSearchPrevious, } /// Search mode specific actions. @@ -506,6 +518,12 @@ pub fn default_key_bindings() -> Vec<KeyBinding> { "n", ModifiersState::SHIFT, +BindingMode::VI, ~BindingMode::SEARCH; ViAction::SearchPrevious; Enter, +BindingMode::VI, ~BindingMode::SEARCH; ViAction::Open; "z", +BindingMode::VI, ~BindingMode::SEARCH; ViAction::CenterAroundViCursor; + "f", +BindingMode::VI, ~BindingMode::SEARCH; ViAction::InlineSearchForward; + "f", ModifiersState::SHIFT, +BindingMode::VI, ~BindingMode::SEARCH; ViAction::InlineSearchBackward; + "t", +BindingMode::VI, ~BindingMode::SEARCH; ViAction::InlineSearchForwardShort; + "t", ModifiersState::SHIFT, +BindingMode::VI, ~BindingMode::SEARCH; ViAction::InlineSearchBackwardShort; + ";", +BindingMode::VI, ~BindingMode::SEARCH; ViAction::InlineSearchNext; + ",", +BindingMode::VI, ~BindingMode::SEARCH; ViAction::InlineSearchPrevious; "k", +BindingMode::VI, ~BindingMode::SEARCH; ViMotion::Up; "j", +BindingMode::VI, ~BindingMode::SEARCH; ViMotion::Down; "h", +BindingMode::VI, ~BindingMode::SEARCH; ViMotion::Left; |