blob: 4765510fa96c36bdd16c08f1b3f3e7315ba7634f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
;;; -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
;;;; dired
(require 'dired)
(keymap-global-set "C-c d" 'dired-jump)
(keymap-set dired-mode-map "h" #'dired-hide-details-mode)
(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
;; "dwim": guess where to move files
dired-dwim-target t
dired-guess-shell-alist-user
`((,(regexp-opt '(".mkv" ".mov" ".mp4" ".webm" ".m4v" ".wav" ".mp3" ".opus" ".ogv" ".flac")) "mpv &")
(,(regexp-opt '(".jpeg" ".jpg" ".png")) "feh &")
(,(regexp-opt '(".pdf")) "pdftotext -nopgbrk -enc UTF-8 -eol unix -layout")
(,(regexp-opt '(".html")) "icecat &")))
;; pdf
(defun bd/zathura (file &rest args)
"Launch zathura ignoring args."
(interactive)
(ignore args)
(start-process "zathura" nil "zathura" file))
(defun bd/pdf-find-file-wrapper (f &rest args)
"Wrapper around F (find-file), passing ARGS."
(if (string-match "\\(?:epub\\|pdf\\)" (or (file-name-extension (car args)) ""))
(progn
(bd/zathura (car args))
(recentf-add-file (car args)))
(apply f args)))
(advice-add 'find-file :around #'bd/pdf-find-file-wrapper)
;;;; transmission
(use-package transmission
:bind
(:map transmission-mode-map
("R" . #'transmission-move)))
(provide 'bd--files)
;;; bd-files ends here
|