Skip to content

Instantly share code, notes, and snippets.

@wiedzmin
Forked from alphapapa/dired.sh
Created November 11, 2020 18:03
Show Gist options
  • Save wiedzmin/205318ef44250a88f839cc23f9fcc9fd to your computer and use it in GitHub Desktop.
Save wiedzmin/205318ef44250a88f839cc23f9fcc9fd 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