Crate duat_hop

Crate duat_hop 

Source
Expand description

A duat Mode to quickly move around the screen, inspired by hop.nvim

This plugin will highlight every word (or line, or a custom regex) in the screen, and let you jump to it with at most 2 keypresses, selecting the matched sequence.

§Installation

Just like other Duat plugins, this one can be installed by calling cargo add in the config directory:

cargo add duat-hop@"*"

Or, if you are using a --git-deps version of duat, do this:

cargo add --git https://github.com/AhoyISki/duat-hop

§Usage

In order to make use of it, just add the following to your setup function:

setup_duat!(setup);
use duat::prelude::*;

fn setup() {
    plug(duat_hop::Hop);
}

When plugging this, the w key will be mapped to Hopper::word in the User mode, while the l key will map onto Hopper::line in the same mode.

§Forms

When plugging Hop will set the "hop" Form to "accent.info". This is then inherited by the following Forms:

  • "hop.one_char" will be used on labels with just one character.
  • "hop.char1" will be used on the first character of two character labels.
  • "hop.char2" will be used on the second character of two character labels. By default, this form inherits "hop.char1".

Which you can modify via form::set:

setup_duat!(setup);
use duat::prelude::*;

fn setup() {
    plug(duat_hop::Hop);

    form::set("hop.one_char", Form::red().underlined());
    form::set("hop.char1", "hop.one_char");
    form::set("hop.char2", "search");
}

Structs§

Hop
The Plugin for the Hopper Mode
Hopper