summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2014-08-01 20:55:27 +0100
committerAlan Pearce2014-08-01 20:55:27 +0100
commit90676d96644c8d4f6f172d7658f00d597fec4194 (patch)
treee82fb9988473b8a56585d1c68f69ee90025ef5dd
parent0ef099b442c8437cee44a2b54503c2c2029815a7 (diff)
downloaddotfiles-90676d96644c8d4f6f172d7658f00d597fec4194.tar.lz
dotfiles-90676d96644c8d4f6f172d7658f00d597fec4194.tar.zst
dotfiles-90676d96644c8d4f6f172d7658f00d597fec4194.zip
Emacs: Recreate header-line setup
-rw-r--r--tag-emacs/emacs.d/init.el91
1 files changed, 90 insertions, 1 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el
index fdf2574..3891d66 100644
--- a/tag-emacs/emacs.d/init.el
+++ b/tag-emacs/emacs.d/init.el
@@ -122,7 +122,12 @@
           (ding))))
 
 (req-package leuven-theme
-  :config (load-theme 'leuven t))
+  :config (progn
+            (load-theme 'leuven t)
+            (setq face-remapping-alist
+                  '((header-line (:box nil) mode-line-inactive)
+                    (mode-line-buffer-id (:weight bold :foreground "#EEF5FE"))))
+))
 
 (when (or (display-graphic-p)
           (daemonp))
@@ -554,6 +559,90 @@
 (column-number-mode t)
 (size-indication-mode t)
 
+(defun fill-line-format (line-format)
+  (max 0
+       (- (window-width)
+          (length (format-mode-line line-format)))))
+
+(defvar mode-line-size
+  `((size-indication-mode
+     ((-3 ,(propertize
+            "%p"
+            'local-map mode-line-column-line-number-mode-map
+            'mouse-face 'mode-line-highlight
+            ;; XXX needs better description
+            'help-echo "Size indication mode\n\
+mouse-1: Display Line and Column Mode Menu"))
+      " "
+      (-4 "%I")))))
+
+(setq-default
+ mode-line-modes (let ((recursive-edit-help-echo "Recursive edit, type C-M-c to get out"))
+                   (list (propertize "%[" 'help-echo recursive-edit-help-echo)
+                         `(:propertize ("" mode-name)
+                                       help-echo "Major mode\n\
+mouse-1: Display major mode menu\n\
+mouse-2: Show help for major mode\n\
+mouse-3: Toggle minor modes"
+                                       mouse-face mode-line-highlight
+                                       local-map ,mode-line-major-mode-keymap)
+                         '("" mode-line-process)
+                         `(:propertize ("" minor-mode-alist)
+                                       mouse-face mode-line-highlight
+                                       help-echo "Minor mode\n\
+mouse-1: Display minor mode menu\n\
+mouse-2: Show help for minor mode\n\
+mouse-3: Toggle minor modes"
+                                       local-map ,mode-line-minor-mode-keymap)
+                         (propertize "%n" 'help-echo "mouse-2: Remove narrowing from buffer"
+                                     'mouse-face 'mode-line-highlight
+                                     'local-map (make-mode-line-mouse-map
+                                                 'mouse-2 #'mode-line-widen))
+                         (propertize "%]" 'help-echo recursive-edit-help-echo)
+                         " "))
+ mode-line-buffer-identification (list (propertize "%b"
+                                                   'face 'mode-line-buffer-id))
+
+ mode-line-position `((line-number-mode
+                       ((column-number-mode
+                         ,(propertize
+                           "%l:%c"
+                           'local-map mode-line-column-line-number-mode-map
+                           'mouse-face 'mode-line-highlight
+                           'help-echo "Line number and Column number\n\
+mouse-1: Display Line and Column Mode Menu")
+                         (6 ,(propertize
+                              "L%l"
+                              'local-map mode-line-column-line-number-mode-map
+                              'mouse-face 'mode-line-highlight
+                              'help-echo "Line Number\n\
+mouse-1: Display Line and Column Mode Menu"))))
+                       ((column-number-mode
+                         (5 ,(propertize
+                              "C%c"
+                              'local-map mode-line-column-line-number-mode-map
+                              'mouse-face 'mode-line-highlight
+                              'help-echo "Column number\n\
+mouse-1: Display Line and Column Mode Menu"))))))
+ mode-line-format `("%e"
+                    " "
+                    mode-line-modes
+                    mode-line-misc-info
+                    (vc-mode vc-mode)
+                    mode-line-end-spaces)
+ header-line-format `("%e"
+                      mode-line-front-space
+                      mode-line-mule-info
+                      mode-line-client
+                      mode-line-modified
+                      mode-line-auto-compile
+                      mode-line-remote " "
+                      mode-line-position " "
+                      mode-line-size
+                      " ⎸ "
+                      mode-line-buffer-identification
+                      ))
+
 ;;;; Modes
 
 ;;;; systemd files