aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/config/bindings.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2021-03-01 19:50:39 +0000
committerGitHub <noreply@github.com>2021-03-01 19:50:39 +0000
commita954e076ca0b1ee9c1f272c2b119c67df3935fd4 (patch)
treef233f8622ac6ab33519bfcb70b480f23697198b1 /alacritty/src/config/bindings.rs
parent772afc6a8aa9db6f89de4b23df27b571a40c9118 (diff)
downloadr-alacritty-a954e076ca0b1ee9c1f272c2b119c67df3935fd4.tar.gz
r-alacritty-a954e076ca0b1ee9c1f272c2b119c67df3935fd4.tar.bz2
r-alacritty-a954e076ca0b1ee9c1f272c2b119c67df3935fd4.zip
Add regex terminal hints
This adds support for hints, which allow opening parts of the visual buffer with external programs if they match a certain regex. This is done using a visual overlay triggered on a specified key binding, which then instructs the user which keys they need to press to pass the text to the application. In the future it should be possible to supply some built-in actions for Copy/Pasting the action and using this to launch text when clicking on it with the mouse. But the current implementation should already be useful as-is. Fixes #2792. Fixes #2536.
Diffstat (limited to 'alacritty/src/config/bindings.rs')
-rw-r--r--alacritty/src/config/bindings.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/alacritty/src/config/bindings.rs b/alacritty/src/config/bindings.rs
index 4d0fcadd..732875db 100644
--- a/alacritty/src/config/bindings.rs
+++ b/alacritty/src/config/bindings.rs
@@ -16,6 +16,8 @@ use alacritty_terminal::config::Program;
use alacritty_terminal::term::TermMode;
use alacritty_terminal::vi_mode::ViMotion;
+use crate::config::ui_config::Hint;
+
/// Describes a state and action to take in that state.
///
/// This is the shared component of `MouseBinding` and `KeyBinding`.
@@ -91,6 +93,10 @@ pub enum Action {
#[config(skip)]
Command(Program),
+ /// Regex keyboard hints.
+ #[config(skip)]
+ Hint(Hint),
+
/// Move vi mode cursor.
#[config(skip)]
ViMotion(ViMotion),
@@ -1132,7 +1138,7 @@ impl<'a> Deserialize<'a> for KeyBinding {
/// Our deserialize impl wouldn't be covered by a derive(Deserialize); see the
/// impl below.
#[derive(Debug, Copy, Clone, Hash, Default, Eq, PartialEq)]
-pub struct ModsWrapper(ModifiersState);
+pub struct ModsWrapper(pub ModifiersState);
impl ModsWrapper {
pub fn into_inner(self) -> ModifiersState {