Skip to content

emacsorphanage/smeargle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smeargle.el

melpa badge melpa stable badge gh actions badge

Highlight regions of a buffer based on the time of most recent update. Older updated region is highlighted lighter, newer region is highlighted darker.

This is Emacs port of Vim's smeargle

Screenshot

smeargle

Installation

smeargle is available on MELPA and MELPA stable

You can install smeargle with the following command.

M-x package-install [RET] smeargle [RET]

Support VCS

Command

M-x smeargle

Highlight regions by last updated time.

M-x smeargle-commits

Highlight regions by age of changes.

M-x smeargle-clear

Clear overlays in current buffer

Customize

You can set highlighted colors of smeargle by changing smeargle-colors. For example

(custom-set-variables
 '(smeargle-colors '((older-than-1day   . "red")
                     (older-than-3day   . "green")
                     (older-than-1week  . "yellow")
                     (older-than-2week  . nil)
                     (older-than-1month . "orange")
                     (older-than-3month . "pink")
                     (older-than-6month . "cyan")
                     (older-than-1year . "grey50"))))

If color parameter is nil, that part is not highlighted.

And you can also set colors of smeargle-commits by smeargle-age-colors.

(custom-set-variables
 '(smeargle-age-colors '((0 . nil)
                         (1 . "grey80")
                         (2 . "grey70")
                         (3 . "grey60")
                         (4 . "grey50")
                         (5 . "grey40")
                         (6 . "grey30")
                         (7 . "grey20")
                         (8 . "grey10"))))

You can specify parameters until smeargle-age-threshold. age is set to smeargle-age-threshold if actual age of changes is older than smeargle-age-threshold. Default value of smeargle-age-threshold is 7.

Sample Configuration

(global-set-key (kbd "C-x v s") 'smeargle)
(global-set-key (kbd "C-x v c") 'smeargle-commits)

;; Highlight regions at opening file
(add-hook 'find-file-hook 'smeargle)

;; Updating after save buffer
(add-hook 'after-save-hook 'smeargle)