163

GitHub - syohex/emacs-dired-k: Highlighting dired buffer like k

 6 years ago
source link: https://github.com/syohex/emacs-dired-k
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

dired-k.el

dired-k.el highlights dired buffer like k.

(This may works only default dired setting)

screenshot

k.zsh style

Screenshot of dired-k command

git status --short style

Screenshot of dired-k with git style

direx version

Screenshot of direx-k

Installation

dired-k is available on MELPA and MELPA stable

You can install dired-k with the following command.

M-x package-install [RET] dired-k [RET]

Commands

dired-k

Highlight dired buffer by following parameters.

  • File size
  • Modified time
  • Git status(if here is in git repository)

dired-k-no-revert

Same as dired-k, except this command does not call revert-buffert. This command can set to a hook dired-after-readin-hook.

Customization

dired-k-style(Default nil)

View like k.zsh if this value is nil. View like git status --short if this value is 'git.

dired-k-human-readable(Default nil)

Set non-nil if you add -h or --human-readable option to dired-listing-switches.

dired-k-padding(Default 0)

Number of spaces around git status character.

Sample Configuration

dired-k

(require 'dired-k)
(define-key dired-mode-map (kbd "K") 'dired-k)

;; You can use dired-k alternative to revert-buffer
(define-key dired-mode-map (kbd "g") 'dired-k)

;; always execute dired-k when dired buffer is opened
(add-hook 'dired-initial-position-hook 'dired-k)

(add-hook 'dired-after-readin-hook #'dired-k-no-revert)

direx-k

(require 'direx-k)

(global-set-key (kbd "C-\\") 'direx-project:jump-to-project-root-other-window)
(define-key direx:direx-mode-map (kbd "K") 'direx-k)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK