Crates.io | duat-hop |
lib.rs | duat-hop |
version | 0.2.0 |
created_at | 2025-06-26 03:39:49.167638+00 |
updated_at | 2025-08-20 20:01:28.137806+00 |
description | A duat plugin to quickly move around words, inspired by hop.nvim |
homepage | |
repository | https://github.com/AhoyISki/duat-hop |
max_upload_size | |
id | 1726832 |
size | 379,276 |
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.
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
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.
When plugging Hop
this crate set the "hop"
Form
to
"accent.info"
. This is then inherited by the following
Form
s:
"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
}