summaryrefslogtreecommitdiff
path: root/modeline.el
diff options
context:
space:
mode:
Diffstat (limited to 'modeline.el')
-rw-r--r--modeline.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/modeline.el b/modeline.el
index 4fda761..a505733 100644
--- a/modeline.el
+++ b/modeline.el
@@ -104,6 +104,25 @@
(modeline-format-major-mode)
(modeline-format-vc-mode)))
+;;; Toggle modeline
+
+(defvar-local modeline-alt-format nil
+ "The variable to store the original mode line format, so that we
+can toggle back the format later on.")
+
+(defun modeline-toggle ()
+ "Toggle the display of the mode line."
+ (interactive)
+ (cond
+ ((null modeline-alt-format)
+ (setq-local modeline-alt-format mode-line-format)
+ (setq-local mode-line-format nil))
+ (t
+ (setq-local mode-line-format modeline-alt-format)
+ (setq-local modeline-alt-format nil))))
+
+(define-key global-map (vector 3 ?T) #'modeline-toggle)
+
;;; Calculate the correct lengths of characters
;;;###autoload