summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--files.el
diff options
context:
space:
mode:
Diffstat (limited to '.config/emacs/modules/bd--files.el')
-rw-r--r--.config/emacs/modules/bd--files.el37
1 files changed, 19 insertions, 18 deletions
diff --git a/.config/emacs/modules/bd--files.el b/.config/emacs/modules/bd--files.el
index 4e19c11..f29383d 100644
--- a/.config/emacs/modules/bd--files.el
+++ b/.config/emacs/modules/bd--files.el
@@ -5,12 +5,13 @@
(use-package recentf
:demand t
+ :bind
+ (("C-x g" . recentf-open))
:init
(recentf-mode 1)
:config
(setopt recentf-max-saved-items 3500
- recentf-keep '(recentf-keep-default-predicate remote-file-p)
- recentf-auto-cleanup 300))
+ recentf-auto-cleanup 300))
(defun bd/zathura (file)
"Open FILE with zathura."
@@ -24,11 +25,11 @@
(defun bd/rom (file)
"Open FILE with an emulator."
(let ((command
- (cdr (assoc (file-name-extension file)
- '(("gba" . "mgba")
- ("z64" . "mupen64plus")
- ("n64" . "mupen64plus")
- ("sfc" . "bsnes"))))))
+ (cdr (assoc (file-name-extension file)
+ '(("gba" . "mgba")
+ ("z64" . "mupen64plus")
+ ("n64" . "mupen64plus")
+ ("sfc" . "bsnes"))))))
(start-process command nil command (expand-file-name file))))
(defun bd/external-find-file-wrapper (f &rest args)
@@ -36,17 +37,17 @@
(defun bd/open-with-function (f)
(funcall f (car args))
(recentf-add-file (car args)))
-
+
(let ((ext (or (file-name-extension (car args)) "")))
(cond
((string-match (regexp-opt '("epub" "pdf")) ext)
(bd/open-with-function #'bd/zathura))
((string-match (regexp-opt '("mkv" "mov" "mp4" "webm" "m4v"
- "wav" "mp3" "opus" "ogv" "flac"
- "m4a")) ext)
+ "wav" "mp3" "opus" "ogv" "flac"
+ "m4a")) ext)
(bd/open-with-function #'bd/mpv))
((string-match (regexp-opt '("jpg" "jpeg" "png" "webp"
- "ico" "gif" "JPG" "PNG")) ext)
+ "ico" "gif" "JPG" "PNG")) ext)
(bd/open-with-function #'bd/nsxiv))
((string-match (regexp-opt '("gba" "z64" "n64" "sfc")) ext)
(bd/open-with-function #'bd/rom))
@@ -59,13 +60,13 @@
(("C-c d" . dired-jump))
:config
(setopt dired-listing-switches "-alhLG --time-style=long-iso --group-directories-first"
- dired-recursive-copies 'always
- dired-recursive-deletes 'always
- dired-auto-revert-buffer t
- dired-dwim-target t
- dired-guess-shell-alist-user
- `((,(regexp-opt '(".pdf")) "pdftotext -nopgbrk -enc UTF-8 -eol unix -layout")
- (,(regexp-opt '(".html")) "icecat &"))))
+ dired-recursive-copies 'always
+ dired-recursive-deletes 'always
+ dired-auto-revert-buffer t
+ dired-dwim-target t
+ dired-guess-shell-alist-user
+ `((,(regexp-opt '(".pdf")) "pdftotext -nopgbrk -enc UTF-8 -eol unix -layout")
+ (,(regexp-opt '(".html")) "icecat &"))))
(use-package transmission
:bind