diff options
author | Tom Willemse | 2016-10-16 22:32:11 +0200 |
---|---|---|
committer | Tom Willemse | 2016-10-16 22:32:32 +0200 |
commit | 36c8b991eeaa75ac2572faff2c4ce58b426a1620 (patch) | |
tree | c0d647864818567b499add5dbcd8c8b5bf020887 /emacs/.emacs.d/init/oni-dired-init.org | |
parent | 01a358e8315f8cf416fed80cba6628ad53454b12 (diff) | |
download | new-dotfiles-36c8b991eeaa75ac2572faff2c4ce58b426a1620.tar.gz new-dotfiles-36c8b991eeaa75ac2572faff2c4ce58b426a1620.zip |
Make sure init files have unique names
Diffstat (limited to 'emacs/.emacs.d/init/oni-dired-init.org')
-rw-r--r-- | emacs/.emacs.d/init/oni-dired-init.org | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/emacs/.emacs.d/init/oni-dired-init.org b/emacs/.emacs.d/init/oni-dired-init.org new file mode 100644 index 0000000..8966d71 --- /dev/null +++ b/emacs/.emacs.d/init/oni-dired-init.org @@ -0,0 +1,43 @@ +#+TITLE: Dired + +#+BEGIN_SRC emacs-lisp + (require 'dired) + (require 'dired-x) +#+END_SRC + +Show human-readable sizes in dired buffers. + +#+BEGIN_SRC emacs-lisp + (setq dired-listing-switches "-alh") +#+END_SRC + +Show the same info for subdirectories, but don't show the =.= and =..= +directories, since those are most likely already shown in the buffer. + +#+BEGIN_SRC emacs-lisp + (setq dired-subdir-switches "-Alh") +#+END_SRC + +Add a keybinding to dired buffers to change to wdired. + +#+BEGIN_SRC emacs-lisp + (defun oni:dired-add-wdired-keybinding () + "Add a keybinding for wdired mode." + (define-key dired-mode-map (kbd "E") 'wdired-change-to-wdired-mode)) + + (add-hook 'dired-mode-hook 'oni:dired-add-wdired-keybinding) +#+END_SRC + +Open PDF files in zathura. + +#+BEGIN_SRC emacs-lisp + (add-to-list 'dired-guess-shell-alist-user + `(,(rx ".pdf" eos) "zathura")) +#+END_SRC + +Open Jpeg, Gif and PNG files in feh. + +#+BEGIN_SRC emacs-lisp + (add-to-list 'dired-guess-shell-alist-user + `(,(rx (or ".jpg" ".jpeg" ".png" ".gif") eos) "feh")) +#+END_SRC |