use crate::core::key::parse_key_string;
use crate::core::trie::BindingTrie;
pub fn default_bindings() -> BindingTrie {
let mut trie = BindingTrie::new();
let mut bind = |keys: &str, cmd: &str| trie.insert(&parse_key_string(keys), cmd.to_string());
bind("h", "scroll left");
bind("j", "scroll down");
bind("k", "scroll up");
bind("l", "scroll right");
bind("gg", "scroll-to-perc 0");
bind("G", "scroll-to-perc 100");
bind("<C-f>", "scroll-page down");
bind("<C-b>", "scroll-page up");
bind("<C-d>", "scroll-page down half");
bind("<C-u>", "scroll-page up half");
bind("H", "back");
bind("L", "forward");
bind("r", "reload");
bind("R", "reload --force");
bind("J", "tab-next");
bind("K", "tab-prev");
bind("d", "tab-close");
bind("u", "undo");
bind("gC", "tab-clone");
bind("gJ", "tab-move +1");
bind("gK", "tab-move -1");
bind("co", "tab-only");
bind("t", "cmd-set-text :tabopen ");
for i in 1..=9 {
bind(&format!("<A-{i}>"), &format!("tab-focus {i}"));
}
bind("f", "hint");
bind("F", "hint-tab");
bind("o", "cmd-set-text :open ");
bind("O", "cmd-set-text :open {url}");
bind(":", "cmd-set-text :");
bind("yy", "yank");
bind("yt", "yank title");
bind("M", "bookmark-add");
bind("m", "cmd-set-text :quickmark-save ");
bind("b", "cmd-set-text :quickmark-load ");
bind("gb", "cmd-set-text :bookmark-load ");
bind("/", "cmd-set-text /");
bind("n", "find-next");
bind("N", "find-prev");
bind("zi", "zoom-in");
bind("zo", "zoom-out");
bind("zz", "zoom-reset");
bind("td", "darkmode");
bind("i", "mode-enter insert");
bind("Escape", "mode-leave");
trie
}