Change theme/font selection; it's .emacs.local.d's responsibility
This commit is contained in:
parent
3103795065
commit
a658d46927
5 changed files with 57 additions and 55 deletions
|
@ -1,18 +1,9 @@
|
||||||
;;; core-defuns.el
|
;;; core-defuns.el
|
||||||
|
|
||||||
;; Bootstrap macro
|
;; Bootstrap macro
|
||||||
(defmacro doom (_ theme __ font &rest packages)
|
(defmacro doom (&rest packages)
|
||||||
"Bootstrap DOOM emacs and initialize PACKAGES"
|
"Bootstrap DOOM emacs and initialize PACKAGES"
|
||||||
`(let (file-name-handler-alist)
|
`(let (file-name-handler-alist)
|
||||||
;; Global constants
|
|
||||||
(defconst doom-default-theme ,theme)
|
|
||||||
(defconst doom-default-font
|
|
||||||
(font-spec :family ,(nth 0 font)
|
|
||||||
:size ,(nth 1 font)
|
|
||||||
:antialias ,(not (nth 2 font))))
|
|
||||||
|
|
||||||
(defconst doom-current-theme doom-default-theme)
|
|
||||||
(defconst doom-current-font doom-default-font)
|
|
||||||
;; Local settings
|
;; Local settings
|
||||||
(load "~/.emacs.local.el" t t)
|
(load "~/.emacs.local.el" t t)
|
||||||
;; Bootstrap
|
;; Bootstrap
|
||||||
|
@ -30,7 +21,6 @@
|
||||||
;; Prevent any auto-displayed text + benchmarking
|
;; Prevent any auto-displayed text + benchmarking
|
||||||
(advice-add 'display-startup-echo-area-message :override 'ignore)
|
(advice-add 'display-startup-echo-area-message :override 'ignore)
|
||||||
(message ""))
|
(message ""))
|
||||||
|
|
||||||
(setq-default gc-cons-threshold 4388608
|
(setq-default gc-cons-threshold 4388608
|
||||||
gc-cons-percentage 0.4)))
|
gc-cons-percentage 0.4)))
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,19 @@
|
||||||
;;; core-ui.el --- interface & mode-line config
|
;;; core-ui.el --- interface & mode-line config
|
||||||
|
|
||||||
(defconst doom-fringe-size '3 "Default fringe width")
|
(defvar doom-ui-fringe-size '3
|
||||||
|
"Default fringe width")
|
||||||
|
|
||||||
|
(defvar doom-ui-theme 'doom-one-dark
|
||||||
|
"The color theme currently in use.")
|
||||||
|
|
||||||
|
(defvar doom-ui-font
|
||||||
|
(font-spec :family "Fira Mono" :size 12)
|
||||||
|
"The font currently in use.")
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
;; Configuration
|
||||||
|
;;
|
||||||
|
|
||||||
(setq-default
|
(setq-default
|
||||||
mode-line-default-help-echo nil ; don't say anything on mode-line mouseover
|
mode-line-default-help-echo nil ; don't say anything on mode-line mouseover
|
||||||
|
@ -33,7 +46,6 @@
|
||||||
;; Minibuffer resizing
|
;; Minibuffer resizing
|
||||||
resize-mini-windows 'grow-only
|
resize-mini-windows 'grow-only
|
||||||
max-mini-window-height 0.3
|
max-mini-window-height 0.3
|
||||||
|
|
||||||
;; Ask for confirmation on exit only if there are real buffers left
|
;; Ask for confirmation on exit only if there are real buffers left
|
||||||
confirm-kill-emacs
|
confirm-kill-emacs
|
||||||
(lambda (_)
|
(lambda (_)
|
||||||
|
@ -44,36 +56,6 @@
|
||||||
;; y/n instead of yes/no
|
;; y/n instead of yes/no
|
||||||
(fset 'yes-or-no-p 'y-or-n-p)
|
(fset 'yes-or-no-p 'y-or-n-p)
|
||||||
|
|
||||||
;; Initialize UI
|
|
||||||
(tooltip-mode -1) ; show tooltips in echo area instead
|
|
||||||
(menu-bar-mode -1) ; no menu in GUI Emacs (or terminal)
|
|
||||||
(when window-system
|
|
||||||
(scroll-bar-mode -1) ; no scrollbar
|
|
||||||
(tool-bar-mode -1) ; no toolbar
|
|
||||||
;; full filename in frame title
|
|
||||||
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
|
|
||||||
;; Set theme and font
|
|
||||||
(with-demoted-errors "FONT ERROR: %s"
|
|
||||||
(set-frame-font doom-default-font t)
|
|
||||||
;; Fallback to `doom-unicode-font' for Unicode characters
|
|
||||||
(set-fontset-font t 'unicode doom-unicode-font))
|
|
||||||
;; standardize fringe width
|
|
||||||
(fringe-mode doom-fringe-size)
|
|
||||||
(push `(left-fringe . ,doom-fringe-size) default-frame-alist)
|
|
||||||
(push `(right-fringe . ,doom-fringe-size) default-frame-alist)
|
|
||||||
;; slightly larger default frame size on startup
|
|
||||||
(push '(width . 120) default-frame-alist)
|
|
||||||
(push '(height . 40) default-frame-alist)
|
|
||||||
;; Slightly transparent frame
|
|
||||||
(push '(alpha . 98) default-frame-alist)
|
|
||||||
;; no fringe in the minibuffer
|
|
||||||
(add-hook! (emacs-startup minibuffer-setup)
|
|
||||||
(set-window-fringes (minibuffer-window) 0 0 nil))
|
|
||||||
;; Show tilde in margin on empty lines
|
|
||||||
(define-fringe-bitmap 'tilde [64 168 16] nil nil 'center)
|
|
||||||
(set-fringe-bitmap-face 'tilde 'fringe)
|
|
||||||
(setcdr (assq 'empty-line fringe-indicator-alist) 'tilde))
|
|
||||||
|
|
||||||
;; mode-line is unimportant in help/compile windows
|
;; mode-line is unimportant in help/compile windows
|
||||||
(add-hook 'help-mode-hook 'doom-hide-mode-line-mode)
|
(add-hook 'help-mode-hook 'doom-hide-mode-line-mode)
|
||||||
(add-hook 'compilation-mode-hook 'doom-hide-mode-line-mode)
|
(add-hook 'compilation-mode-hook 'doom-hide-mode-line-mode)
|
||||||
|
@ -110,7 +92,7 @@
|
||||||
:config
|
:config
|
||||||
(setq doom-neotree-enable-variable-pitch t
|
(setq doom-neotree-enable-variable-pitch t
|
||||||
doom-neotree-line-spacing 3)
|
doom-neotree-line-spacing 3)
|
||||||
(load-theme doom-current-theme t)
|
(load-theme doom-ui-theme t)
|
||||||
;; brighter source buffers
|
;; brighter source buffers
|
||||||
(add-hook 'find-file-hook 'doom-buffer-mode)
|
(add-hook 'find-file-hook 'doom-buffer-mode)
|
||||||
;; brighter minibuffer when active
|
;; brighter minibuffer when active
|
||||||
|
@ -210,5 +192,39 @@
|
||||||
visual-fill-column-width fill-column
|
visual-fill-column-width fill-column
|
||||||
split-window-preferred-function 'visual-line-mode-split-window-sensibly))
|
split-window-preferred-function 'visual-line-mode-split-window-sensibly))
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
;; Bootstrap
|
||||||
|
;;
|
||||||
|
|
||||||
|
(tooltip-mode -1) ; relegate tooltips to echo area only
|
||||||
|
(menu-bar-mode -1)
|
||||||
|
(when window-system
|
||||||
|
(scroll-bar-mode -1)
|
||||||
|
(tool-bar-mode -1)
|
||||||
|
;; full filename in frame title
|
||||||
|
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
|
||||||
|
;; Set theme and font
|
||||||
|
(with-demoted-errors "FONT ERROR: %s"
|
||||||
|
(set-frame-font doom-ui-font t)
|
||||||
|
;; Fallback to `doom-unicode-font' for Unicode characters
|
||||||
|
(set-fontset-font t 'unicode doom-ui-font))
|
||||||
|
;; standardize fringe width
|
||||||
|
(fringe-mode doom-ui-fringe-size)
|
||||||
|
(push `(left-fringe . ,doom-ui-fringe-size) default-frame-alist)
|
||||||
|
(push `(right-fringe . ,doom-ui-fringe-size) default-frame-alist)
|
||||||
|
;; slightly larger default frame size on startup
|
||||||
|
(push '(width . 120) default-frame-alist)
|
||||||
|
(push '(height . 40) default-frame-alist)
|
||||||
|
;; Slightly transparent frame
|
||||||
|
(push '(alpha . 98) default-frame-alist)
|
||||||
|
;; no fringe in the minibuffer
|
||||||
|
(add-hook! (emacs-startup minibuffer-setup)
|
||||||
|
(set-window-fringes (minibuffer-window) 0 0 nil))
|
||||||
|
;; Show tilde in margin on empty lines
|
||||||
|
(define-fringe-bitmap 'tilde [64 168 16] nil nil 'center)
|
||||||
|
(set-fringe-bitmap-face 'tilde 'fringe)
|
||||||
|
(setcdr (assq 'empty-line fringe-indicator-alist) 'tilde))
|
||||||
|
|
||||||
(provide 'core-ui)
|
(provide 'core-ui)
|
||||||
;;; core-ui.el ends here
|
;;; core-ui.el ends here
|
||||||
|
|
|
@ -25,23 +25,23 @@
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/reset-theme ()
|
(defun doom/reset-theme ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(doom/load-theme (or doom-current-theme doom-default-theme)))
|
(doom/load-theme doom-ui-theme))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/load-font (font)
|
(defun doom/load-font (font)
|
||||||
(interactive)
|
(interactive)
|
||||||
(set-frame-font font t)
|
(set-frame-font font t)
|
||||||
(setq doom-current-font font))
|
(setq doom-ui-font font))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/load-theme (theme &optional suppress-font)
|
(defun doom/load-theme (theme &optional suppress-font)
|
||||||
(interactive)
|
(interactive)
|
||||||
(when doom-current-theme
|
(when doom-ui-theme
|
||||||
(disable-theme doom-current-theme))
|
(disable-theme doom-ui-theme))
|
||||||
(load-theme theme t)
|
(load-theme theme t)
|
||||||
(unless suppress-font
|
(unless suppress-font
|
||||||
(doom/load-font doom-current-font))
|
(doom/load-font doom-current-font))
|
||||||
(setq doom-current-theme theme))
|
(setq doom-ui-theme theme))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/show-as (how &optional pred)
|
(defun doom/show-as (how &optional pred)
|
||||||
|
|
6
init.el
6
init.el
|
@ -30,11 +30,7 @@
|
||||||
|
|
||||||
(load (concat user-emacs-directory "core/core"))
|
(load (concat user-emacs-directory "core/core"))
|
||||||
|
|
||||||
(doom :theme 'doom-one
|
(doom core-popup ; taming sudden and inevitable windows
|
||||||
:font ("Fira Mono" 12)
|
|
||||||
|
|
||||||
;;; The heart of DOOM
|
|
||||||
core-popup ; taming sudden and inevitable windows
|
|
||||||
core-os ; os-specific configs
|
core-os ; os-specific configs
|
||||||
core-ui ; draw me like one of your French editors
|
core-ui ; draw me like one of your French editors
|
||||||
core-modeline ; a self-contained mode-line config for masochists
|
core-modeline ; a self-contained mode-line config for masochists
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
(defconst write-mode-font (font-spec :family "Source Sans Pro" :size 14))
|
(defconst write-mode-font (font-spec :family "Source Sans Pro" :size 14))
|
||||||
|
|
||||||
(defconst write-mode--last-mode-line mode-line-format)
|
(defconst write-mode--last-mode-line mode-line-format)
|
||||||
(defconst write-mode--last-theme doom-current-theme)
|
(defconst write-mode--last-theme doom-ui-theme)
|
||||||
(defconst write-mode--last-line-spacing line-spacing)
|
(defconst write-mode--last-line-spacing line-spacing)
|
||||||
|
|
||||||
(defun doom-write-mode-line (&optional id)
|
(defun doom-write-mode-line (&optional id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue