dired-xdg-open

This commit is contained in:
Abraham Raji 2020-01-13 23:50:55 +05:30
parent 0424e62dd6
commit 128897bfd3
1 changed files with 10 additions and 0 deletions

View File

@ -42,3 +42,13 @@ Ask before recursively deleting a directory, though.
#+BEGIN_SRC emacs-lisp
(setq dired-recursive-deletes 'top)
#+END_SRC
Open a file with an external program (that is, through xdg-open) by hitting C-c C-o.
#+BEGIN_SRC emacs-lisp
(defun dired-xdg-open ()
"In dired, open the file named on this line."
(interactive)
(let* ((file (dired-get-filename nil t)))
(call-process "xdg-open" nil 0 nil file)))
(define-key dired-mode-map (kbd "C-c C-o") 'dired-xdg-open)
#+END_SRC