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. -- Save all we can and leave.
rekey_normal("<Leader>z", "<cmd>lua bye()<cr>") rekey_normal("<Leader>z", "<cmd>lua bye()<cr>")
-- Just leave, no saves.
rekey_normal("<Leader>Z", "<cmd>qa!<cr>")
-- Remap ; to :. -- Remap ; to :.
rekey_normal(";", ":") rekey_normal(";", ":")
rekey_visual(";", ":") rekey_visual(";", ":")

View file

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