minmo : docs
This commit is contained in:
parent
aa70079b44
commit
8b3203d2d0
1 changed files with 32 additions and 29 deletions
|
|
@ -1,22 +1,31 @@
|
||||||
;; minmo.el -*- lexical-binding: t; -*-
|
;; minmo.el --- minimal mode-line -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; my mode line is extremely minimal. However there are a few things I want:
|
;; my mode line is extremely minimal. However there are a few things I want:
|
||||||
;;
|
;;
|
||||||
;; buffer-name
|
;; buffer-name
|
||||||
;; major-mode
|
;; git and disk status
|
||||||
;; project-name
|
;; project-name
|
||||||
;; git branch
|
;; git branch
|
||||||
;; git and disk status
|
;; major-mode
|
||||||
;; minor-mode very selectively
|
;; minor-mode very selectively
|
||||||
;; narrow indicator
|
;; narrow indicator
|
||||||
;; line:col
|
;; line:col
|
||||||
;; lines
|
;; lines
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;; buffer-name
|
||||||
|
|
||||||
|
(defun minmo-buffer-name ()
|
||||||
|
(if (mode-line-window-selected-p)
|
||||||
|
(propertize (buffer-name) 'face 'success)
|
||||||
|
(buffer-name)))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;; git and disk status
|
;;; git and disk status
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; unified symbol set for git and disk status on tty and pts
|
;; unified symbol set for git and disk status on tty and pts
|
||||||
|
;;
|
||||||
;; disk git
|
;; disk git
|
||||||
;; unmodified : ◻ : grey grey
|
;; unmodified : ◻ : grey grey
|
||||||
;; --
|
;; --
|
||||||
|
|
@ -26,8 +35,10 @@
|
||||||
;; new : ◰ : blue
|
;; new : ◰ : blue
|
||||||
;; nofile/untracked : ◲ : blue red
|
;; nofile/untracked : ◲ : blue red
|
||||||
|
|
||||||
;; left nodule for git means: ready for commit
|
;; left ◱◰ : staged/new : indexed
|
||||||
;; right nodule for git means: unaffected by next commit
|
;; right ◳◲ : ignored/untracked : unindexed
|
||||||
|
;; top ◰◳ : new/ignored : clean
|
||||||
|
;; bottom ◱◲ : staged/untracked : dirty
|
||||||
|
|
||||||
(defconst minmo-status-alist
|
(defconst minmo-status-alist
|
||||||
'(
|
'(
|
||||||
|
|
@ -165,30 +176,6 @@ Uses the fast `vc-state' cache rather than synchronous git calls."
|
||||||
(t (minmo--status 'unmodified 'disk))
|
(t (minmo--status 'unmodified 'disk))
|
||||||
))
|
))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
;;; buffer-name
|
|
||||||
|
|
||||||
(defun minmo-buffer-name ()
|
|
||||||
(if (mode-line-window-selected-p)
|
|
||||||
(propertize (buffer-name) 'face 'success)
|
|
||||||
(buffer-name)))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
;;; major-mode
|
|
||||||
|
|
||||||
;; current solution is to throw out a few redundant, obvious modes.
|
|
||||||
;; NOTE: using major-mode directly, rather than mode-name, because
|
|
||||||
;; the "pretty print" format is annoying.
|
|
||||||
(defun minmo-major-mode ()
|
|
||||||
(unless (member major-mode '(
|
|
||||||
um-mode
|
|
||||||
markdown-mode
|
|
||||||
emacs-lisp-mode
|
|
||||||
))
|
|
||||||
;; major-mode is first evaluated, then the symbol-name of
|
|
||||||
;; the return value is fetched as string:
|
|
||||||
(concat " " (symbol-name major-mode))))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;; project
|
;;; project
|
||||||
|
|
||||||
|
|
@ -215,6 +202,22 @@ Uses the fast `vc-state' cache rather than synchronous git calls."
|
||||||
|
|
||||||
(add-hook 'find-file-hook #'minmo--cache-project)
|
(add-hook 'find-file-hook #'minmo--cache-project)
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;; major-mode
|
||||||
|
|
||||||
|
;; current solution is to throw out a few redundant, obvious modes.
|
||||||
|
;; NOTE: using major-mode directly, rather than mode-name, because
|
||||||
|
;; the "pretty print" format is annoying.
|
||||||
|
(defun minmo-major-mode ()
|
||||||
|
(unless (member major-mode '(
|
||||||
|
um-mode
|
||||||
|
markdown-mode
|
||||||
|
emacs-lisp-mode
|
||||||
|
))
|
||||||
|
;; major-mode is first evaluated, then the symbol-name of
|
||||||
|
;; the return value is fetched as string:
|
||||||
|
(concat " " (symbol-name major-mode))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;; input-method
|
;;; input-method
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue