Skip to content

Instantly share code, notes, and snippets.

@alphapapa
Last active April 4, 2021 09:37
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alphapapa/9c4eea0f204f865d37e8c99963feb922 to your computer and use it in GitHub Desktop.
Save alphapapa/9c4eea0f204f865d37e8c99963feb922 to your computer and use it in GitHub Desktop.
Standalone Dired launcher
#!/bin/bash
# Launch Dired in a plain Emacs configuration.
# Arguments are passed to Emacs, e.g. "-nw" works as expected.
emacs -q "$@" \
--eval "(dired default-directory)" \
--eval "(defun kill-window-or-emacs () (interactive) (if (one-window-p) (kill-emacs) (delete-window)))" \
--eval "(setq dired-dwim-target t delete-by-moving-to-trash t)" \
--eval "(define-key dired-mode-map (kbd \"q\") #'kill-window-or-emacs)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment