Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Status on files and on window

If you want to have a StatusLine per Buffer, you can add the following:

#![allow(unused)]
fn main() {
use duat::prelude::*;
setup_duat!(setup);

fn setup() {
    hook::add::<Buffer>(|pa, handle| {
        status!("{name_txt}{Spacer}{main_txt}").above().push_on(pa, handle);
        Ok(())
    });
}
}

The snippet above will place a StatusLine above every single Buffer.

You can go further with this, what if you want different StatusLines, depending on the Buffer?

#![allow(unused)]
fn main() {
use duat::prelude::*;
setup_duat!(setup);

fn setup() {
    hook::add::<Buffer>(|pa, handle| {
        let status = if handle.read(pa).path().contains(".config/duat") {
            status!("{name_txt}[config] []{Spacer}{main_txt}")
        } else {
            status!("{name_txt}{Spacer}{main_txt}")
        };

        status.above().push_on(pa, handle);
        Ok(())
    });
}
}