Yazi : Add support for name open matching.
This commit is contained in:
parent
ad44bf91d4
commit
3b0c69aa00
|
@ -81,22 +81,25 @@
|
||||||
|
|
||||||
open = {
|
open = {
|
||||||
rules = let
|
rules = let
|
||||||
mkRule = mime: use: { inherit mime; use = use ++ [ "text" "hex" ]; };
|
defaultUse = [ "text" "hex" ];
|
||||||
|
mkMime = mime: use: { inherit mime; use = use ++ defaultUse; };
|
||||||
|
mkName = name: use: { inherit name; use = use ++ defaultUse; };
|
||||||
in [
|
in [
|
||||||
# Use `file -i file.txt` to find file mime type.
|
# Use `file -i file.txt` to find file mime type.
|
||||||
# Use `xdg-mime query default "text/plain"` to find default app.
|
# Use `xdg-mime query default "text/plain"` to find default app.
|
||||||
(mkRule "application/gzip" [ "archive" ])
|
(mkMime "application/gzip" [ "archive" ])
|
||||||
(mkRule "application/x-tar" [ "archive" ])
|
(mkMime "application/x-tar" [ "archive" ])
|
||||||
(mkRule "application/x-xz" [ "archive" ])
|
(mkMime "application/x-xz" [ "archive" ])
|
||||||
(mkRule "application/zip" [ "archive" ])
|
(mkMime "application/zip" [ "archive" ])
|
||||||
(mkRule "application/x-7z-compressed" [ "archive" ])
|
(mkMime "application/x-7z-compressed" [ "archive" ])
|
||||||
(mkRule "application/pdf" [ "pdf" ])
|
(mkMime "application/pdf" [ "pdf" ])
|
||||||
(mkRule "audio/*" [ "audio" ])
|
(mkMime "audio/*" [ "audio" ])
|
||||||
(mkRule "image/*" [ "image" "image_edit" ])
|
(mkName "*.mka" [ "audio" ])
|
||||||
(mkRule "video/*" [ "video" ])
|
(mkMime "image/*" [ "image" "image_edit" ])
|
||||||
(mkRule "text/html" [ "browser" ])
|
(mkMime "video/*" [ "video" ])
|
||||||
(mkRule "application/vnd.openxmlformats-officedocument.*" [ "document" ])
|
(mkMime "text/html" [ "browser" ])
|
||||||
(mkRule "*" [ ])
|
(mkMime "application/vnd.openxmlformats-officedocument.*" [ "document" ])
|
||||||
|
(mkMime "*" [ ])
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue