duat-hop

Crates.ioduat-hop
lib.rsduat-hop
version0.2.0
created_at2025-06-26 03:39:49.167638+00
updated_at2025-08-20 20:01:28.137806+00
descriptionA duat plugin to quickly move around words, inspired by hop.nvim
homepage
repositoryhttps://github.com/AhoyISki/duat-hop
max_upload_size
id1726832
size379,276
ahoyiski (AhoyISki)

documentation

README

duat-hop License: AGPL-3.0-or-later duat-hop on crates.io duat-hop on docs.rs Source Code Repository

hop demonstration

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@"*" --rename hop

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

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

Usage

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

# use duat_core::doc_duat as duat;
setup_duat!(setup);
use duat::prelude::*;
use hop::*;

fn setup() {
    plug!(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 this crate 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 secondcharacter of two character labels.

Which you can modify via form::set:

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

fn setup() {
    plug!(Hop);

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

cargo fmt