diff --git a/README.md b/README.md index b0a2244..e0886b7 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # minmo -`minmo` is a (min)imal (mo)de-line with aggressive caching and tight semantics. +`minmo` is a (min)imal (mo)de-line with `O(1)` git and disk status via aggressive caching and tight semantics. This package exists because I wasn't satisfied either with emacs defaults nor any of the more elaborate alternatives. Unfortunately the builtin `vc` package tries much too hard to be compatible with obsolete version control systems no one uses, and as a result has poor performance and more limited functionality than if it consolidated on git. `minmo` addresses these problems: -1. `auto-revert-check-vc-info` calls `git status` on *all open vc-enabled buffers*, regardless of their display status. Even on modern hardware, there's a noticeable lag above about 100 open files. `minmo` uses various hooks and the `minmo-git-cache-timer-interval` to update git status only for *visible* buffers, e.g. when calling `switch-to-buffer` or `find-file`. +1. `auto-revert-check-vc-info` calls `git status` on *all open vc-enabled buffers*, regardless of their display status: essentially `O(N)` cost. Even on modern hardware, there's a noticeable lag above about 100 open files. `minmo` uses various hooks and the `minmo-git-cache-timer-interval` to update git status only for *visible* buffers, e.g. when calling `switch-to-buffer` or `find-file`. 2. The `vc-mode` string reports a generic status designed before the existence of git: namely it doesn't report staged status. Moreover the status strings are clunky and difficult to change. @@ -16,7 +16,7 @@ Both timers can be disabled by setting those intervals to nil, if you want even ## install -``` +```elisp (use-package minmo :vc (:url "https://git.bth.moi/bth/minmo" :rev :newest)) ``` @@ -44,6 +44,14 @@ bottom ◱◲ : modified/untracked : unready After a while, you may find them intuitive. But all of this can be changed easily by redefining `minmo-status-alist`. Just copy the default and change strings and faces as you like. +## screenshots + +In my own theme, `modus-vivendi`, and `solaris-dark`: + +![screenshot](img/redeye.png) +![screenshot](img/modus-vivendi.png) +![screenshot](img/solaris-dark.png) + ## mode-line-format `minmo` sets `mode-line-format` to provide: @@ -62,7 +70,7 @@ But `mode-line-format` can easily be set as you wish, using the default as a sta If you wanted an even more minimal mode-line, eval something like this: -``` +```elisp (setq-default mode-line-format (list @@ -71,3 +79,13 @@ If you wanted an even more minimal mode-line, eval something like this: '(:eval (minmo-disk-status)) )) ``` + +## auto-revert-mode + +`global-auto-revert-mode` can still be enabled, but I recommend the following when using `minmo` to avoid unnecesary polling: + +```elisp +(setopt auto-revert-check-vc-info nil + auto-revert-use-notify t + auto-revert-avoid-polling t) +``` diff --git a/img/modus-vivendi.png b/img/modus-vivendi.png new file mode 100644 index 0000000..cd8058b Binary files /dev/null and b/img/modus-vivendi.png differ diff --git a/img/redeye.png b/img/redeye.png new file mode 100644 index 0000000..f0f908b Binary files /dev/null and b/img/redeye.png differ diff --git a/img/solaris-dark.png b/img/solaris-dark.png new file mode 100644 index 0000000..cefaeef Binary files /dev/null and b/img/solaris-dark.png differ diff --git a/minmo.el b/minmo.el index d513005..0144068 100644 --- a/minmo.el +++ b/minmo.el @@ -68,6 +68,8 @@ :group 'convenience :prefix "minmo-") + + (defcustom minmo-status-alist '( (unmodified . (((unicode . "◻") (ascii . ".")) . ((disk . nil) (git . nil))))