A convienent way to look up file contents in other window while browsing directory in dired
Emacs Lisp Gherkin Makefile
Switch branches/tags
Nothing to show
Clone or download

README.md

Peep Dired

This is a minor mode that can be enabled from a dired buffer. Once enabled it will show the file from point in the other window. Moving to the other file within the dired buffer with down/up or C-n/C-p will display different file. Hitting SPC will scroll the peeped file down, whereas C-SPC and backspace will scroll it up.

Screenshot

Installation

Once you have setup Melpa you can use package-install command to install Peep Dired. The package name is peep-dired.

Configuration

Customizing

When disabling the mode you can choose to kill the buffers that were opened while browsing the directories.

(setq peep-dired-cleanup-on-disable t)

Or you can choose to kill the buffer just after you move to another entry in the dired buffer.

(setq peep-dired-cleanup-eagerly t)

If you want the dired buffers that were peeped to have the mode enabled set it to true.

(setq peep-dired-enable-on-directories t)

Evil integration

Adjust the state name depending on an evil state you open dired in:

(evil-define-key 'normal peep-dired-mode-map (kbd "<SPC>") 'peep-dired-scroll-page-down
                                             (kbd "C-<SPC>") 'peep-dired-scroll-page-up
                                             (kbd "<backspace>") 'peep-dired-scroll-page-up
                                             (kbd "j") 'peep-dired-next-file
                                             (kbd "k") 'peep-dired-prev-file)
(add-hook 'peep-dired-hook 'evil-normalize-keymaps)

Ignoring Certain File Extensions

You probably don't want to open certain files like videos when using Peep Dired. To ignore certain files when moving over them you can customize the following to your liking:

(setq peep-dired-ignored-extensions '("mkv" "iso" "mp4"))

Alternatives

  • ranger.el emulates ranger in dired. It has the preview feature similar to Peep-Dired.

Contribution

Install cask if you haven't already, then:

$ cd /path/to/peep-dired
$ cask

Run all tests with:

$ make test