Launch an external application from dired
dired-launch is a launcher for the Emacs dired-mode. In a nutshell, it lets you select a file and then launch an external application with that file.
If MELPA is enabled as an Emacs package repository, it should be possible to install simply using M-x
list-packages and selecting the
dired-launch package for installation (i x).
Getting started without the Emacs package manager
dired-launch.el. For example, you might add the following line to
dired-launchis enabled in
Ensure dired-launch is configured as desired
Ensure the default launcher specified by
dired-launch-default-launcher is the desired program. For example, one might specify
xdg-open as the default launcher:
;; use xdg-open as the default launcher (setq dired-launch-default-launcher '("xdg-open"))
Move the cursor to a file of interest
dired-launch-command) launches the file using the preferred application
dired-launch-with-prompt-command) prompts for the application and then launches the file
Modifying the default keybindings
If you prefer different key bindings, consider modifying the defaults.
`(define-key dired-launch-mode-map (kbd "l") 'dired-launch-command)`
Changing the preferred application
Change the preferred (default) application for a given file type by invoking mimeopen with the '-d' flag:
mimeopen -d myfile