add the ability to open external apps from dired

This commit is contained in:
Chris Cochrun 2021-03-17 13:43:35 -05:00
parent 784f8413d2
commit aa13c8e774
3 changed files with 22 additions and 6 deletions

13
init.el
View file

@ -315,13 +315,20 @@ vertically."
(use-package dired
:ensure nil
:straight nil
:config
(defun chris/dired-open-xdg ()
"Open the file-at-point in the appropriate program"
(interactive)
(let ((file (ignore-errors (dired-get-file-for-visit))))
(browse-url (file-truename file))))
:general
(chris/leader-keys
:states 'normal
:keymaps 'override
"od" '(dired-jump :which-key "open dired here"))
(general-def 'normal dired-mode-map
"q" 'kill-this-buffer))
"q" 'kill-this-buffer
"C-<return>" 'chris/dired-open-xdg))
(defun chris/dired-yank-filename ()
"Get the full filename from file at point and put into kill-ring"
@ -995,12 +1002,12 @@ If on a:
(propertize path 'face `(:inherit org-level-1))))
(when chris/eshell-status-p
(propertize (or (chris/eshell-status-display) "") 'face font-lock-comment-face))
(propertize "\n" 'face '(:inherit org-todo :weight ultra-bold))
(propertize "\n" 'face '(:inherit org-todo :weight ultra-bold))
" "))))
;;; If the prompt spans over multiple lines, the regexp should match
;;; last line only.
(setq-default eshell-prompt-regexp "^ ")
(setq-default eshell-prompt-regexp "^ ")
(setq eshell-destroy-buffer-when-process-dies t)
(defun chris/pop-eshell ()