summaryrefslogtreecommitdiff
path: root/modules/custom-buffer-file.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-02-25 12:07:12 -0600
committerCraig Jennings <c@cjennings.net>2026-02-25 12:07:12 -0600
commitf755e54ee94df29e345e5ca5d53ce95b6f53a9a7 (patch)
treeb10bfe801e0a21bf76792897cf1474a60887f180 /modules/custom-buffer-file.el
parent6ec4857d0c4c1f43b42bb83c355e150f1aabd4d8 (diff)
feat(buffer): add open-with-default-app and open-with-program keybindings
Wire cj/xdg-open (C-; b o) and cj/open-this-file-with (C-; b O) into the buffer keymap. Fix xdg-open fallback to try buffer-file-name before dired context. Remove old C-c x o binding from external-open.
Diffstat (limited to 'modules/custom-buffer-file.el')
-rw-r--r--modules/custom-buffer-file.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/custom-buffer-file.el b/modules/custom-buffer-file.el
index 92e73c3d..f99a0ee4 100644
--- a/modules/custom-buffer-file.el
+++ b/modules/custom-buffer-file.el
@@ -32,6 +32,7 @@
;; mm-decode for email viewing (mm-handle-type is a macro, needs early require)
(require 'mm-decode)
+(require 'external-open) ;; for cj/xdg-open, cj/open-this-file-with
;; cj/kill-buffer-and-window defined in undead-buffers.el
(declare-function cj/kill-buffer-and-window "undead-buffers")
@@ -446,7 +447,9 @@ Signals an error if:
"S" #'write-file ;; save as
"g" #'revert-buffer
"w" #'cj/view-buffer-in-eww
- "e" #'cj/view-email-in-buffer)
+ "e" #'cj/view-email-in-buffer
+ "o" #'cj/xdg-open
+ "O" #'cj/open-this-file-with)
(when (boundp 'cj/custom-keymap)
(keymap-set cj/custom-keymap "b" cj/buffer-and-file-map))
@@ -473,7 +476,9 @@ Signals an error if:
"C-; b S" "save as"
"C-; b g" "revert buffer"
"C-; b w" "view in EWW"
- "C-; b e" "view email"))
+ "C-; b e" "view email"
+ "C-; b o" "open with default app"
+ "C-; b O" "open with program..."))
(provide 'custom-buffer-file)