duat-hop 0.2.2

A duat plugin to quickly move around words, inspired by hop.nvim
Documentation
  • Coverage
  • 83.33%
    5 out of 6 items documented1 out of 6 items with examples
  • Size
  • Source code size: 825.09 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 830.55 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 59s Average build duration of successful builds.
  • all releases: 50s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • AhoyISki/duat-hop
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • AhoyISki

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

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");
}