Yazi : Add text and hex by default to all files.

This commit is contained in:
Dmitry Voronin 2024-06-24 15:43:38 +03:00
parent 23d036b676
commit 2c6fa18226
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 16 additions and 15 deletions

View file

@ -34,6 +34,9 @@
-- Save all we can and leave.
rekey_normal("<Leader>z", "<cmd>lua bye()<cr>")
-- Just leave, no saves.
rekey_normal("<Leader>Z", "<cmd>qa!<cr>")
-- Remap ; to :.
rekey_normal(";", ":")
rekey_visual(";", ":")

View file

@ -70,27 +70,25 @@
hex = [{
desc = "Hex";
block = true;
run = openWith "radare2 -c V";
run = openWith "radare2 -c V -w";
}];
};
open = {
rules = let
mkRule = mime: use: { inherit mime use; };
mkRule = mime: use: { inherit mime; use = use ++ [ "text" "hex" ]; };
in [
(mkRule "application/gzip" "archive")
(mkRule "application/json" "text")
(mkRule "application/octet-stream" [ "text" "hex" ])
(mkRule "application/pdf" "pdf")
(mkRule "application/x-tar" "archive")
(mkRule "application/x-xz" "archive")
(mkRule "application/zip" "archive")
(mkRule "audio/*" "audio")
(mkRule "image/*" "image")
(mkRule "text/html" [ "browser" "text" ])
(mkRule "text/*" "text")
(mkRule "video/*" "video")
(mkRule "application/vnd.openxmlformats-officedocument.*" "document")
(mkRule "application/gzip" [ "archive" ])
(mkRule "application/x-tar" [ "archive" ])
(mkRule "application/x-xz" [ "archive" ])
(mkRule "application/zip" [ "archive" ])
(mkRule "application/pdf" [ "pdf" ])
(mkRule "audio/*" [ "audio" ])
(mkRule "image/*" [ "image" ])
(mkRule "video/*" [ "video" ])
(mkRule "text/html" [ "browser" ])
(mkRule "application/vnd.openxmlformats-officedocument.*" [ "document" ])
(mkRule "*" [ ])
];
};
};