2024-10-11 23:27:07 +03:00
|
|
|
{ pkgs, ... }:
|
2024-11-02 08:06:48 +03:00
|
|
|
let
|
|
|
|
mkKeymap = desc: on: run: { inherit desc on run; };
|
|
|
|
in
|
2024-10-11 23:27:07 +03:00
|
|
|
{
|
2024-11-02 08:06:48 +03:00
|
|
|
# REF: https://github.com/sxyazi/yazi/blob/main/yazi-config/preset/keymap.toml
|
2024-10-11 23:27:07 +03:00
|
|
|
file = (pkgs.formats.toml { }).generate "YaziKeymapConfig" {
|
|
|
|
manager = {
|
|
|
|
prepend_keymap = [
|
2024-11-02 08:06:48 +03:00
|
|
|
(mkKeymap "Delete" "d" "remove --permanently")
|
|
|
|
(mkKeymap "Delete no questions asked" "D" "remove --permanently --force")
|
|
|
|
(mkKeymap "Spawn shell here" "<Enter>" ''shell "SHELL_NAME=yazi $SHELL" --block --confirm'')
|
|
|
|
(mkKeymap "Open interactively" "o" "open --interactive")
|
|
|
|
(mkKeymap "Open default" "O" "open")
|
|
|
|
# I wanna die thanks to nixfmt.
|
|
|
|
(mkKeymap "Go to storage" [
|
|
|
|
"g"
|
|
|
|
"s"
|
|
|
|
] "cd /storage")
|
|
|
|
(mkKeymap "Go to tmp" [
|
|
|
|
"g"
|
|
|
|
"t"
|
|
|
|
] "cd ~/tmp")
|
|
|
|
(mkKeymap "Go to system tmp" [
|
|
|
|
"g"
|
|
|
|
"T"
|
|
|
|
] "cd /tmp")
|
|
|
|
(mkKeymap "Go to projects" [
|
|
|
|
"g"
|
|
|
|
"p"
|
|
|
|
] "cd ~/project")
|
|
|
|
# Yazi devs are... special.
|
|
|
|
(mkKeymap "Go to downloads" [
|
|
|
|
"g"
|
|
|
|
"d"
|
|
|
|
] "cd $XDG_DOWNLOAD_DIR")
|
|
|
|
(mkKeymap "Go to configs" [
|
|
|
|
"g"
|
|
|
|
"c"
|
|
|
|
] "cd $XDG_CONFIG_HOME")
|
2024-10-11 23:27:07 +03:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2024-06-22 23:34:03 +03:00
|
|
|
}
|