Last active
January 2, 2023 21:22
-
-
Save bzg/8578998 to your computer and use it in GitHub Desktop.
Emacs, naked
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Prevent the cursor from blinking | |
(blink-cursor-mode 0) | |
;; Don't use messages that you don't read | |
(setq initial-scratch-message "") | |
(setq inhibit-startup-message t) | |
;; Don't let Emacs hurt your ears | |
(setq visible-bell t) | |
;; You need to set `inhibit-startup-echo-area-message' from the | |
;; customization interface: | |
;; M-x customize-variable RET inhibit-startup-echo-area-message RET | |
;; then enter your username | |
(setq inhibit-startup-echo-area-message "guerry") | |
;; This is bound to f11 in Emacs 24.4 | |
(toggle-frame-fullscreen) | |
;; Who use the bar to scroll? | |
(scroll-bar-mode 0) | |
(tool-bar-mode 0) | |
(menu-bar-mode 0) | |
;; You can also set the initial frame parameters | |
;; (setq initial-frame-alist | |
;; '((menu-bar-lines . 0) | |
;; (tool-bar-lines . 0))) | |
;; See http://bzg.fr/emacs-hide-mode-line.html | |
(defvar-local hidden-mode-line-mode nil) | |
(defvar-local hide-mode-line nil) | |
(define-minor-mode hidden-mode-line-mode | |
"Minor mode to hide the mode-line in the current buffer." | |
:init-value nil | |
:global nil | |
:variable hidden-mode-line-mode | |
:group 'editing-basics | |
(if hidden-mode-line-mode | |
(setq hide-mode-line mode-line-format | |
mode-line-format nil) | |
(setq mode-line-format hide-mode-line | |
hide-mode-line nil)) | |
(force-mode-line-update) | |
;; Apparently force-mode-line-update is not always enough to | |
;; redisplay the mode-line | |
(redraw-display) | |
(when (and (called-interactively-p 'interactive) | |
hidden-mode-line-mode) | |
(run-with-idle-timer | |
0 nil 'message | |
(concat "Hidden Mode Line Mode enabled. " | |
"Use M-x hidden-mode-line-mode to make the mode-line appear.")))) | |
;; Activate hidden-mode-line-mode | |
(hidden-mode-line-mode 1) | |
;; If you want to hide the mode-line in all new buffers | |
;; (add-hook 'after-change-major-mode-hook 'hidden-mode-line-mode) | |
;; Alternatively, you can paint your mode-line in White but then | |
;; you'll have to manually paint it in black again | |
;; (custom-set-faces | |
;; '(mode-line-highlight ((t nil))) | |
;; '(mode-line ((t (:foreground "white" :background "white")))) | |
;; '(mode-line-inactive ((t (:background "white" :foreground "white"))))) | |
;; A small minor mode to use a big fringe | |
(defvar bzg-big-fringe-mode nil) | |
(define-minor-mode bzg-big-fringe-mode | |
"Minor mode to hide the mode-line in the current buffer." | |
:init-value nil | |
:global t | |
:variable bzg-big-fringe-mode | |
:group 'editing-basics | |
(if (not bzg-big-fringe-mode) | |
(set-fringe-style nil) | |
(set-fringe-mode | |
(/ (- (frame-pixel-width) | |
(* 100 (frame-char-width))) | |
2)))) | |
;; Now activate this global minor mode | |
(bzg-big-fringe-mode 1) | |
;; To activate the fringe by default and deactivate it when windows | |
;; are split vertically, uncomment this: | |
;; (add-hook 'window-configuration-change-hook | |
;; (lambda () | |
;; (if (delq nil | |
;; (let ((fw (frame-width))) | |
;; (mapcar (lambda(w) (< (window-width w) fw)) | |
;; (window-list)))) | |
;; (bzg-big-fringe-mode 0) | |
;; (bzg-big-fringe-mode 1)))) | |
;; Use a minimal cursor | |
;; (setq cursor-type 'hbar) | |
;; Get rid of the indicators in the fringe | |
(mapcar (lambda(fb) (set-fringe-bitmap-face fb 'org-hide)) | |
fringe-bitmaps) | |
;; Set the color of the fringe | |
(custom-set-faces | |
'(fringe ((t (:background "white"))))) | |
(custom-set-faces | |
'(default ((t (:background "black" :foreground "grey")))) | |
'(fringe ((t (:background "black"))))) | |
;; Command to toggle the display of the mode-line as a header | |
(defvar-local header-line-format nil) | |
(defun mode-line-in-header () | |
(interactive) | |
(if (not header-line-format) | |
(setq header-line-format mode-line-format | |
mode-line-format nil) | |
(setq mode-line-format header-line-format | |
header-line-format nil)) | |
(set-window-buffer nil (current-buffer))) | |
(global-set-key (kbd "C-s-SPC") 'mode-line-in-header) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi BZG, I use and love large portions of this. I decided to keep my zenburn theme, however, and this caused an issue with the big fringe mode.
Results in a slightly darkened version of the indicator still appearing in the fringe.
I had better success removing the continuation indicator from the
alist
entirely and restoring it when coming out of big fringe mode. Other indicators I thought would still be useful to have, and and appear infrequently enough to keep without breaking my concentration. It would be relatively trivial to remove the other indicators.I also changed the
set-fringe-mode
toset-fringe-style
so that it only works in the current frame. This is annoying if you want to set another frame into big fringe mode as well, but it is better than the alternative, and usually my second frame is not large enough to bother "big-fringing".I also use
window-total-width
instead offrame-pixel-width
, so that there are no negative side effects to using big fringe mode in a split-frame, so long as it the windows are the same size. Otherwise it would do crazy-weird things sometimes if I would absent-mindedly engage the big fringes.Don't think I did anything else except make the width 80 columns.
Thanks so much for the original!