pub struct User;Expand description
A blank Mode, intended for plugin authors to use
The only key this Mode actually accepts is KeyCode::Esc, in
which case it promptly resets to the default Buffer Mode,
which is duatmode’s “Normal” by default.
This means that you can compose more complex expressions and
accrue them in the User mode. For example, something that I find
particularly useful in prose filetypes is the following:
use duat::prelude::*;
setup_duat!(setup);
fn setup() {
map::<User>("f", "<Esc><A-j>|fold -s -w 80<Enter>")
.doc("Fold selected lines by whitespace");
}This is also where Plugin remappings should be done:
use duat::prelude::*;
map::<User>("fb", |pa: &mut Pass| {
mode::set(pa, mode::RunCommands::new_with("frobnificate "));
});
cmd::add("frobnificate", |pa: &mut Pass, buf: Handle| {
// Do stuff
Ok(None)
});Trait Implementations§
impl Copy for User
Auto Trait Implementations§
impl Freeze for User
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnsafeUnpin for User
impl UnwindSafe for User
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more