Refactor core config
This commit is contained in:
parent
b135b7bf53
commit
11a5e15e4e
6 changed files with 122 additions and 114 deletions
|
@ -30,7 +30,7 @@ executed when called with `@set'. FORMS are not evaluated until `@set' calls it.
|
||||||
(if (functionp fn)
|
(if (functionp fn)
|
||||||
(apply fn (eval `(list ,@values)))
|
(apply fn (eval `(list ,@values)))
|
||||||
(when doom-debug-mode
|
(when doom-debug-mode
|
||||||
(warn "No setting found for %s" keyword)))))
|
(message "No setting found for %s" keyword)))))
|
||||||
|
|
||||||
|
|
||||||
;; (defun describe-setting ()
|
;; (defun describe-setting ()
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
;;; core-editor.el --- filling the editor shaped hole in the Emacs OS
|
;;; core-editor.el --- filling the editor shaped hole in the Emacs OS
|
||||||
|
|
||||||
(setq shift-select-mode t ; activate mark on shift-click
|
(setq-default
|
||||||
|
shift-select-mode t ; activate mark on shift-click
|
||||||
;; Save clipboard contents into kill-ring before replacing them
|
;; Save clipboard contents into kill-ring before replacing them
|
||||||
save-interprogram-paste-before-kill t
|
save-interprogram-paste-before-kill t
|
||||||
;; Bookmarks
|
;; Bookmarks
|
||||||
|
@ -31,12 +32,7 @@
|
||||||
truncate-lines t
|
truncate-lines t
|
||||||
truncate-partial-width-windows 50
|
truncate-partial-width-windows 50
|
||||||
visual-fill-column-center-text nil
|
visual-fill-column-center-text nil
|
||||||
word-wrap t
|
word-wrap t)
|
||||||
;; clipboard
|
|
||||||
x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)
|
|
||||||
;; Use a shared clipboard
|
|
||||||
select-enable-clipboard t
|
|
||||||
select-enable-primary t)
|
|
||||||
|
|
||||||
;; Save point across sessions
|
;; Save point across sessions
|
||||||
(require 'saveplace)
|
(require 'saveplace)
|
||||||
|
@ -71,7 +67,6 @@
|
||||||
"^/var/folders/.+$" "^/tmp/.+")
|
"^/var/folders/.+$" "^/tmp/.+")
|
||||||
recentf-max-menu-items 0
|
recentf-max-menu-items 0
|
||||||
recentf-max-saved-items 250
|
recentf-max-saved-items 250
|
||||||
recentf-auto-cleanup 600
|
|
||||||
recentf-filename-handlers '(abbreviate-file-name))
|
recentf-filename-handlers '(abbreviate-file-name))
|
||||||
(@quiet (recentf-mode 1))
|
(@quiet (recentf-mode 1))
|
||||||
|
|
||||||
|
@ -136,17 +131,20 @@
|
||||||
;; Autoloaded Plugins
|
;; Autoloaded Plugins
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(@def-package ace-link :commands (ace-link-help ace-link-org))
|
(@def-package ace-link
|
||||||
|
:commands (ace-link-help ace-link-org))
|
||||||
|
|
||||||
(@def-package ace-window
|
(@def-package ace-window
|
||||||
:commands ace-window
|
:commands ace-window
|
||||||
:config (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
|
:config
|
||||||
|
(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
|
||||||
aw-scope 'frame
|
aw-scope 'frame
|
||||||
aw-background t))
|
aw-background t))
|
||||||
|
|
||||||
(@def-package avy
|
(@def-package avy
|
||||||
:commands (avy-goto-char-2 avy-goto-line)
|
:commands (avy-goto-char-2 avy-goto-line)
|
||||||
:config (setq avy-all-windows nil
|
:config
|
||||||
|
(setq avy-all-windows nil
|
||||||
avy-background t))
|
avy-background t))
|
||||||
|
|
||||||
(@def-package command-log-mode
|
(@def-package command-log-mode
|
||||||
|
@ -161,7 +159,8 @@
|
||||||
:config (emr-initialize)
|
:config (emr-initialize)
|
||||||
(define-key popup-menu-keymap [escape] 'keyboard-quit))
|
(define-key popup-menu-keymap [escape] 'keyboard-quit))
|
||||||
|
|
||||||
(@def-package expand-region :commands (er/expand-region er/contract-region er/mark-symbol er/mark-word))
|
(@def-package expand-region
|
||||||
|
:commands (er/expand-region er/contract-region er/mark-symbol er/mark-word))
|
||||||
|
|
||||||
(@def-package goto-last-change :commands goto-last-change)
|
(@def-package goto-last-change :commands goto-last-change)
|
||||||
|
|
||||||
|
@ -178,7 +177,8 @@
|
||||||
|
|
||||||
(@def-package rotate-text
|
(@def-package rotate-text
|
||||||
:commands (rotate-text rotate-text-backward)
|
:commands (rotate-text rotate-text-backward)
|
||||||
:config (push '("true" "false") rotate-text-words))
|
:config
|
||||||
|
(push '("true" "false") rotate-text-words))
|
||||||
|
|
||||||
(@def-package smart-forward
|
(@def-package smart-forward
|
||||||
:commands (smart-up smart-down smart-backward smart-forward))
|
:commands (smart-up smart-down smart-backward smart-forward))
|
||||||
|
|
|
@ -58,7 +58,8 @@ compilation."
|
||||||
((symbol-function 'write-region)
|
((symbol-function 'write-region)
|
||||||
(lambda (start end filename &optional append visit lockname mustbenew)
|
(lambda (start end filename &optional append visit lockname mustbenew)
|
||||||
(unless visit (setq visit 'no-message))
|
(unless visit (setq visit 'no-message))
|
||||||
(doom--old-write-region-fn start end filename append visit lockname mustbenew)))
|
(doom--old-write-region-fn
|
||||||
|
start end filename append visit lockname mustbenew)))
|
||||||
(inhibit-message t)
|
(inhibit-message t)
|
||||||
(save-silently t))
|
(save-silently t))
|
||||||
,@forms)))
|
,@forms)))
|
||||||
|
@ -109,7 +110,9 @@ Examples:
|
||||||
(files (plist-get plist :files))
|
(files (plist-get plist :files))
|
||||||
(pred (plist-get plist :when)))
|
(pred (plist-get plist :when)))
|
||||||
(cond ((or files in pred)
|
(cond ((or files in pred)
|
||||||
(when (and files (not (or (listp files) (stringp files))))
|
(when (and files
|
||||||
|
(not (or (listp files)
|
||||||
|
(stringp files))))
|
||||||
(user-error "@associate :files expects a string or list of strings"))
|
(user-error "@associate :files expects a string or list of strings"))
|
||||||
(let ((hook-name (intern (format "doom--init-mode-%s" mode))))
|
(let ((hook-name (intern (format "doom--init-mode-%s" mode))))
|
||||||
(macroexp-progn
|
(macroexp-progn
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
;;; core-projects.el --- tools for getting around your project
|
;;; core-projects.el --- tools for getting around your project
|
||||||
|
|
||||||
;; I want Emacs to be nominally aware of the projects. `projectile' provides
|
;; I want Emacs to be aware of the projects. `projectile' provides tools for
|
||||||
;; tools for digging through project files and exposing an API I can use to make
|
;; digging through project files and exposing an API I can use to make other
|
||||||
;; other plugins/features project-aware.
|
;; plugins/features project-aware.
|
||||||
|
|
||||||
(@def-package projectile :demand t
|
(@def-package projectile :demand t
|
||||||
:init
|
:init
|
||||||
|
|
|
@ -2,13 +2,8 @@
|
||||||
|
|
||||||
(defvar doom-ui-fringe-size '3 "Default fringe width")
|
(defvar doom-ui-fringe-size '3 "Default fringe width")
|
||||||
|
|
||||||
(defvar doom-ui-default-background "#333333"
|
(setq-default
|
||||||
"The default frame background color.")
|
bidi-display-reordering nil ; disable bidirectional text for tiny performance boost
|
||||||
|
|
||||||
(defvar doom-ui-default-foreground "#CCCCCC"
|
|
||||||
"The default frame foreground color.")
|
|
||||||
|
|
||||||
(setq bidi-display-reordering nil ; disable bidirectional text for tiny performance boost
|
|
||||||
blink-matching-paren nil ; don't blink--too distracting
|
blink-matching-paren nil ; don't blink--too distracting
|
||||||
cursor-in-non-selected-windows nil ; hide cursors in other windows
|
cursor-in-non-selected-windows nil ; hide cursors in other windows
|
||||||
frame-inhibit-implied-resize t
|
frame-inhibit-implied-resize t
|
||||||
|
@ -19,6 +14,10 @@
|
||||||
image-animate-loop t
|
image-animate-loop t
|
||||||
indicate-buffer-boundaries nil
|
indicate-buffer-boundaries nil
|
||||||
indicate-empty-lines nil
|
indicate-empty-lines nil
|
||||||
|
jit-lock-defer-time nil
|
||||||
|
jit-lock-stealth-nice 0.1
|
||||||
|
jit-lock-stealth-time 0.2
|
||||||
|
jit-lock-stealth-verbose nil
|
||||||
max-mini-window-height 0.3
|
max-mini-window-height 0.3
|
||||||
mode-line-default-help-echo nil ; disable mode-line mouseovers
|
mode-line-default-help-echo nil ; disable mode-line mouseovers
|
||||||
resize-mini-windows 'grow-only ; Minibuffer resizing
|
resize-mini-windows 'grow-only ; Minibuffer resizing
|
||||||
|
@ -66,7 +65,7 @@ disabled.")
|
||||||
doom--mode-line nil))
|
doom--mode-line nil))
|
||||||
(force-mode-line-update))
|
(force-mode-line-update))
|
||||||
;; Ensure major-mode or theme changes don't overwrite these variables
|
;; Ensure major-mode or theme changes don't overwrite these variables
|
||||||
(put 'doom--old-modeline 'permanent-local t)
|
(put 'doom--old-modeline-format 'permanent-local t)
|
||||||
(put 'doom-hide-modeline-mode 'permanent-local t)
|
(put 'doom-hide-modeline-mode 'permanent-local t)
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,14 +79,12 @@ disabled.")
|
||||||
(scroll-bar-mode -1)
|
(scroll-bar-mode -1)
|
||||||
(tool-bar-mode -1)
|
(tool-bar-mode -1)
|
||||||
;; buffer name in frame title
|
;; buffer name in frame title
|
||||||
(setq-default frame-title-format '("%b"))
|
(setq-default frame-title-format '("DOOM Emacs"))
|
||||||
;; standardize fringe width
|
;; standardize fringe width
|
||||||
(fringe-mode doom-ui-fringe-size)
|
(fringe-mode doom-ui-fringe-size)
|
||||||
(setq default-frame-alist
|
(setq default-frame-alist
|
||||||
(append `((left-fringe . ,doom-ui-fringe-size)
|
(append `((left-fringe . ,doom-ui-fringe-size)
|
||||||
(right-fringe . ,doom-ui-fringe-size)
|
(right-fringe . ,doom-ui-fringe-size))
|
||||||
(background-color . ,doom-ui-default-background)
|
|
||||||
(foreground-color . ,doom-ui-default-foreground))
|
|
||||||
default-frame-alist))
|
default-frame-alist))
|
||||||
;; no fringe in the minibuffer
|
;; no fringe in the minibuffer
|
||||||
(@add-hook (emacs-startup minibuffer-setup)
|
(@add-hook (emacs-startup minibuffer-setup)
|
||||||
|
@ -160,12 +157,12 @@ file."
|
||||||
(remove-hook 'after-save-hook 'doom|adjust-indent-guides t)
|
(remove-hook 'after-save-hook 'doom|adjust-indent-guides t)
|
||||||
(delete-trailing-whitespace))))
|
(delete-trailing-whitespace))))
|
||||||
|
|
||||||
;; Some modes don't adequately highlight numbers, therefore...
|
;; For modes that don't adequately highlight numbers
|
||||||
(@def-package highlight-numbers :commands highlight-numbers-mode)
|
(@def-package highlight-numbers :commands highlight-numbers-mode)
|
||||||
|
|
||||||
;; Line highlighting
|
;; Line highlighting
|
||||||
(@def-package hl-line ; built-in
|
(@def-package hl-line ; built-in
|
||||||
:init
|
:config
|
||||||
;; stickiness doesn't play nice with emacs 25+
|
;; stickiness doesn't play nice with emacs 25+
|
||||||
(setq hl-line-sticky-flag nil
|
(setq hl-line-sticky-flag nil
|
||||||
global-hl-line-sticky-flag nil))
|
global-hl-line-sticky-flag nil))
|
||||||
|
@ -174,7 +171,9 @@ file."
|
||||||
;; plugin than the built-in `linum'.
|
;; plugin than the built-in `linum'.
|
||||||
(@def-package nlinum
|
(@def-package nlinum
|
||||||
:commands nlinum-mode
|
:commands nlinum-mode
|
||||||
:preface (defvar nlinum-format "%4d ")
|
:preface
|
||||||
|
(defvar linum-format "%3d ")
|
||||||
|
(defvar nlinum-format "%4d ")
|
||||||
:init
|
:init
|
||||||
(@add-hook
|
(@add-hook
|
||||||
(markdown-mode prog-mode scss-mode web-mode conf-mode groovy-mode
|
(markdown-mode prog-mode scss-mode web-mode conf-mode groovy-mode
|
||||||
|
|
12
core/core.el
12
core/core.el
|
@ -69,12 +69,14 @@ and `doom-initialize-autoloads'.")
|
||||||
(setq-default buffer-file-coding-system 'utf-8) ; with sugar on top
|
(setq-default buffer-file-coding-system 'utf-8) ; with sugar on top
|
||||||
|
|
||||||
;; Configuration
|
;; Configuration
|
||||||
(setq ad-redefinition-accept 'accept ; silence advised function warnings
|
(setq-default
|
||||||
|
ad-redefinition-action 'accept ; silence advised function warnings
|
||||||
apropos-do-all t ; make `apropos' more useful
|
apropos-do-all t ; make `apropos' more useful
|
||||||
compilation-always-kill t ; kill compilation process before starting another
|
compilation-always-kill t ; kill compilation process before starting another
|
||||||
compilation-ask-about-save nil ; save all buffers on `compile'
|
compilation-ask-about-save nil ; save all buffers on `compile'
|
||||||
compilation-scroll-output t
|
compilation-scroll-output t
|
||||||
confirm-nonexistent-file-or-buffer t
|
confirm-nonexistent-file-or-buffer t
|
||||||
|
custom-file (concat doom-cache-dir "custom.el")
|
||||||
enable-recursive-minibuffers nil
|
enable-recursive-minibuffers nil
|
||||||
debug-on-error (and (not noninteractive) doom-debug-mode)
|
debug-on-error (and (not noninteractive) doom-debug-mode)
|
||||||
idle-update-delay 1 ; update ui less often
|
idle-update-delay 1 ; update ui less often
|
||||||
|
@ -87,12 +89,16 @@ and `doom-initialize-autoloads'.")
|
||||||
create-lockfiles nil
|
create-lockfiles nil
|
||||||
history-length 1000
|
history-length 1000
|
||||||
make-backup-files nil
|
make-backup-files nil
|
||||||
vc-make-backup-files nil)
|
vc-make-backup-files nil
|
||||||
|
;; in case of `persistent-soft'
|
||||||
|
pcache-directory (concat doom-cache-dir "pcache/"))
|
||||||
|
|
||||||
;; be quiet at startup
|
;; be quiet at startup
|
||||||
(advice-add 'display-startup-echo-area-message :override 'ignore)
|
(advice-add 'display-startup-echo-area-message :override 'ignore)
|
||||||
(setq inhibit-startup-message t
|
(setq inhibit-startup-message t
|
||||||
inhibit-startup-echo-area-message user-login-name)
|
inhibit-startup-echo-area-message user-login-name
|
||||||
|
initial-major-mode 'fundamental-mode
|
||||||
|
initial-scratch-message nil)
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue