From cb2982c3cbc9360929845801724befe5302be37d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 1 Mar 2021 12:13:28 -0600 Subject: Re-indent --- init.el | 361 +++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 188 insertions(+), 173 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 9808ae2..2eef38e 100644 --- a/init.el +++ b/init.el @@ -67,23 +67,23 @@ ;; Minibuffer (setq-default minibuffer-prompt-properties '(read-only t - cursor-intangible t - face minibuffer-prompt) + cursor-intangible t + face minibuffer-prompt) enable-recursive-minibuffers t file-name-shadow-properties '(invisible t)) (file-name-shadow-mode +1) (minibuffer-depth-indicate-mode +1) (use-package savehist - :straight nil - :init - (setq-default - savehist-file (expand-file-name "history" acdw/var-dir) - savehist-additional-variables '(kill-ring search-ring regexp-search-ring) - history-length t - history-delete-duplicates t - savehist-autosave-interval 60) - :config (savehist-mode +1)) + :straight nil + :init + (setq-default + savehist-file (expand-file-name "history" acdw/var-dir) + savehist-additional-variables '(kill-ring search-ring regexp-search-ring) + history-length t + history-delete-duplicates t + savehist-autosave-interval 60) + :config (savehist-mode +1)) ;; Backups (setq-default backup-by-copying t @@ -101,63 +101,64 @@ (setq-default create-lockfiles nil) ; Are these necessary? ;; Autosaves +(setq auto-save-default nil ; Don't use `auto-save' system + ) (use-package super-save - :defer 5 ; This package can wait - :init - (setq-default - auto-save-default nil ; Don't use `auto-save' system - super-save-remote-files nil ; Don't save remote files - super-save-exclude '(".gpg") ; Wouldn't work anyway - super-save-auto-save-when-idle t) - :config - (super-save-mode +1)) + :defer 5 ; This package can wait + :init + (setq-default + super-save-remote-files nil ; Don't save remote files + super-save-exclude '(".gpg") ; Wouldn't work anyway + super-save-auto-save-when-idle t) + :config + (super-save-mode +1)) ;; Auto-revert (global-auto-revert-mode +1) ; Automatically revert a file ; to its on-disk contents (use-package saveplace - :straight nil - :init - (setq-default - save-place-file (expand-file-name "places" acdw/var-dir) - save-place-forget-unreadable-files (eq acdw/system :home)) - :config (save-place-mode +1)) + :straight nil + :init + (setq-default + save-place-file (expand-file-name "places" acdw/var-dir) + save-place-forget-unreadable-files (eq acdw/system :home)) + :config (save-place-mode +1)) (use-package recentf - :straight nil - :init - (setq recentf-save-file (expand-file-name "recentf" acdw/var-dir) - recentf-max-menu-items 100 - recentf-max-saved-items nil - recentf-auto-cleanup 'never) - (defun maybe-save-recentf () - "Save `recentf-file' every five minutes, but only when out of focus." - (defvar recentf--last-save (time-convert nil 'integer) - "When we last saved the `recentf-save-list'.") - - (when (> (time-convert (time-since recentf--last-save) 'integer) - (* 60 5)) - (setq-default recentf--last-save (time-convert nil 'integer)) - (when-unfocused #'recentf-save-list))) - :config - (recentf-mode +1) - (add-to-list 'recentf-exclude acdw/var-dir) - (add-to-list 'recentf-exclude acdw/etc-dir) - (add-function :after after-focus-change-function - #'maybe-save-recentf)) + :straight nil + :init + (setq recentf-save-file (expand-file-name "recentf" acdw/var-dir) + recentf-max-menu-items 100 + recentf-max-saved-items nil + recentf-auto-cleanup 'never) + (defun maybe-save-recentf () + "Save `recentf-file' every five minutes, but only when out of focus." + (defvar recentf--last-save (time-convert nil 'integer) + "When we last saved the `recentf-save-list'.") + + (when (> (time-convert (time-since recentf--last-save) 'integer) + (* 60 5)) + (setq-default recentf--last-save (time-convert nil 'integer)) + (when-unfocused #'recentf-save-list))) + :config + (recentf-mode +1) + (add-to-list 'recentf-exclude acdw/var-dir) + (add-to-list 'recentf-exclude acdw/etc-dir) + (add-function :after after-focus-change-function + #'maybe-save-recentf)) ;; Uniquify (use-package uniquify - :straight nil - :init - (setq-default - uniquify-buffer-name-style 'forward ; bubble 'up' the directory tree - uniquify-separator "/" ; separate path elements - uniquify-after-kill-buffer-p t ; hook into buffer kills - uniquify-ignore-buffers-re "^\\*" ; don't worry about special buffers - )) + :straight nil + :init + (setq-default + uniquify-buffer-name-style 'forward ; bubble 'up' the directory tree + uniquify-separator "/" ; separate path elements + uniquify-after-kill-buffer-p t ; hook into buffer kills + uniquify-ignore-buffers-re "^\\*" ; don't worry about special buffers + )) ;; Scratch (setq-default @@ -253,10 +254,10 @@ (add-hook 'visual-line-mode-hook #'hook--visual-line-fix-org-keys) (use-package visual-fill-column - :init (setq-default visual-fill-column-center-text t) - :hook visual-fill-column-mode - :config - (advice-add 'text-scale-adjust :after #'visual-fill-column-adjust)) + :init (setq-default visual-fill-column-center-text t) + :hook visual-fill-column-mode + :config + (advice-add 'text-scale-adjust :after #'visual-fill-column-adjust)) (when (fboundp 'global-so-long-mode) (global-so-long-mode +1)) @@ -273,7 +274,7 @@ tab-width 8) (use-package smart-tabs-mode - :config + :config (smart-tabs-insinuate 'c 'c++ 'java 'javascript 'cperl 'python 'ruby 'nxml)) ;; Window layouts @@ -305,37 +306,37 @@ ;; Theming (use-package form-feed - :config (global-form-feed-mode +1)) + :config (global-form-feed-mode +1)) (use-package modus-themes - :straight (:host gitlab :repo "protesilaos/modus-themes") - :demand - :init - (setq-default modus-themes-slanted-constructs t - modus-themes-bold-constructs t - modus-themes-region 'bg-only - modus-themes-org-blocks 'grayscale - modus-themes-headings '((1 . section) - (t . no-color)) - modus-themes-scale-headings nil - modus-themes-mode-line nil) - :custom-face - (modus-theme-heading-1 - ((t (:inherit (modus-theme-heading-1 fixed-pitch bold))))) - (modus-theme-heading-2 - ((t (:inherit (modus-theme-heading-2 fixed-pitch bold))))) - (modus-theme-heading-3 - ((t (:inherit (modus-theme-heading-3 fixed-pitch bold))))) - (modus-theme-heading-4 - ((t (:inherit (modus-theme-heading-4 fixed-pitch bold))))) - (modus-theme-heading-5 - ((t (:inherit (modus-theme-heading-5 fixed-pitch bold))))) - (modus-theme-heading-6 - ((t (:inherit (modus-theme-heading-6 fixed-pitch bold))))) - (modus-theme-heading-7 - ((t (:inherit (modus-theme-heading-7 fixed-pitch bold))))) - (modus-theme-heading-8 - ((t (:inherit (modus-theme-heading-8 fixed-pitch bold)))))) + :straight (:host gitlab :repo "protesilaos/modus-themes") + :demand + :init + (setq-default modus-themes-slanted-constructs t + modus-themes-bold-constructs t + modus-themes-region 'bg-only + modus-themes-org-blocks 'grayscale + modus-themes-headings '((1 . section) + (t . no-color)) + modus-themes-scale-headings nil + modus-themes-mode-line nil) + :custom-face + (modus-theme-heading-1 + ((t (:inherit (modus-theme-heading-1 fixed-pitch bold))))) + (modus-theme-heading-2 + ((t (:inherit (modus-theme-heading-2 fixed-pitch bold))))) + (modus-theme-heading-3 + ((t (:inherit (modus-theme-heading-3 fixed-pitch bold))))) + (modus-theme-heading-4 + ((t (:inherit (modus-theme-heading-4 fixed-pitch bold))))) + (modus-theme-heading-5 + ((t (:inherit (modus-theme-heading-5 fixed-pitch bold))))) + (modus-theme-heading-6 + ((t (:inherit (modus-theme-heading-6 fixed-pitch bold))))) + (modus-theme-heading-7 + ((t (:inherit (modus-theme-heading-7 fixed-pitch bold))))) + (modus-theme-heading-8 + ((t (:inherit (modus-theme-heading-8 fixed-pitch bold)))))) ;; Change themes based on time of day @@ -364,12 +365,12 @@ #'modus-themes-load-vivendi) (use-package minions - :config (minions-mode +1)) + :config (minions-mode +1)) (which-function-mode +1) (use-package which-key - :config (which-key-mode +1)) + :config (which-key-mode +1)) (delete-selection-mode +1) @@ -383,14 +384,13 @@ ) (use-package smartscan - :config - (global-smartscan-mode +1)) + :config (global-smartscan-mode +1)) (when (fboundp 'global-goto-address-mode) (global-goto-address-mode +1)) (use-package flyspell - :init + :init (setenv "LANG" "en_US") (setq-default ispell-program-name "hunspell" ispell-dictionary "en_US" @@ -404,7 +404,7 @@ (write-region "" nil ispell-personal-dictionary nil 0))) (use-package flyspell-correct - :bind ("C-;" . flyspell-correct-wrapper)) + :bind ("C-;" . flyspell-correct-wrapper)) (setq-default show-paren-delay 0 show-paren-style 'mixed @@ -425,20 +425,20 @@ compilation-scroll-output 'first-error) (use-package reformatter - :demand) + :demand) ;; Shell scripts (setq-default sh-basic-offset 8 smie-indent-basic 8) (use-package flymake-shellcheck - :when (executable-find "shellcheck") - :hook sh-mode) + :when (executable-find "shellcheck") + :hook sh-mode) (when (executable-find "shfmt") (reformatter-define sh-format - :program "shfmt" - :lighter "Shfmt") + :program "shfmt" + :lighter "Shfmt") (add-hook 'sh-mode-hook #'sh-format-on-save-mode)) (bind-key "M-/" #'hippie-expand) @@ -456,27 +456,27 @@ ;; Smart hungry delete (use-package smart-hungry-delete - :defer nil - :bind (("" . smart-hungry-delete-backward-char) - ("C-d" . smart-hungry-delete-forward-char)) - :config (smart-hungry-delete-add-default-hooks)) + :defer nil + :bind (("" . smart-hungry-delete-backward-char) + ("C-d" . smart-hungry-delete-forward-char)) + :config (smart-hungry-delete-add-default-hooks)) ;; Enable all commands (setq-default disabled-command-function nil) ;; Magit (use-package magit - :bind ("C-z g" . magit-status)) + :bind ("C-z g" . magit-status)) ;; crux (use-package crux - :straight (:host github :repo "bbatsov/crux") - :bind - ("M-o" . crux-other-window-or-switch-buffer) - :config - (crux-with-region-or-line kill-ring-save) - (crux-with-region-or-line kill-region) - (crux-with-region-or-line comment-or-uncomment-region)) + :straight (:host github :repo "bbatsov/crux") + :bind + ("M-o" . crux-other-window-or-switch-buffer) + :config + (crux-with-region-or-line kill-ring-save) + (crux-with-region-or-line kill-region) + (crux-with-region-or-line comment-or-uncomment-region)) ;; Completion and... stuff (setq-default @@ -485,7 +485,7 @@ read-file-name-completion-ignore-case t) (use-package icomplete-vertical - :demand + :demand :init (setq-default icomplete-delay-completions-threshold 0 @@ -507,67 +507,82 @@ (icomplete-vertical-mode +1)) (use-package orderless - :after icomplete - :init (setq-default completion-styles '(orderless))) + :after icomplete + :init (setq-default completion-styles '(orderless))) (use-package marginalia - :after icomplete - :init (setq-default marginalia-annotators - '(marginalia-annotators-heavy - marginalia-annotators-light)) - :config (marginalia-mode +1)) + :after icomplete + :init (setq-default marginalia-annotators + '(marginalia-annotators-heavy + marginalia-annotators-light)) + :config (marginalia-mode +1)) (use-package consult - :after icomplete - :bind (;; C-c bindings (mode-specific-map) - ("C-c h" . consult-history) - ("C-c m" . consult-mode-command) - ("C-c b" . consult-bookmark) - ("C-c k" . consult-kmacro) - ;; C-x bindings (ctl-x-map) - ("C-x M-:" . consult-complex-command) ; orig. repeat-complet-command - ("C-x b" . consult-buffer) ; orig. switch-to-buffer - ("C-x 4 b" . consult-buffer-other-window) ; orig. switch-to-buffer-other-window - ("C-x 5 b" . consult-buffer-other-frame) ; orig. switch-to-buffer-other-frame - ;; Custom M-# bindings for fast register access - ("M-#" . consult-register-load) - ("M-'" . consult-register-store) ; orig. abbrev-prefix-mark (unrelated) - ("C-M-#" . consult-register) - ;; Other custom bindings - ("M-y" . consult-yank-pop) ; orig. yank-pop - (" a" . consult-apropos) ; orig. apropos-command - ;; M-g bindings (goto-map) - ("M-g e" . consult-compile-error) - ("M-g g" . consult-goto-line) ; orig. goto-line - ("M-g M-g" . consult-goto-line) ; orig. goto-line - ("M-g o" . consult-outline) - ("M-g m" . consult-mark) - ("M-g k" . consult-global-mark) - ("M-g i" . consult-imenu) - ("M-g I" . consult-project-imenu) - ;; M-s bindings (search-map) - ("M-s f" . consult-find) - ("M-s L" . consult-locate) - ("M-s g" . consult-grep) - ("M-s G" . consult-git-grep) - ("M-s r" . consult-ripgrep) - ("M-s l" . consult-line) - ("M-s m" . consult-multi-occur) - ("M-s k" . consult-keep-lines) - ("M-s u" . consult-focus-lines) - ;; Isearch integration - ("M-s e" . consult-isearch) - :map isearch-mode-map - ("M-e" . consult-isearch) ; orig. isearch-edit-string - ("M-s e" . consult-isearch) ; orig. isearch-edit-string - ("M-s l" . consult-line)) ; required by consult-line to detect isearch - :init - (setq register-preview-delay 0 - register-preview-function #'consult-register-format) - (advice-add #'register-preview :override #'consult-register-window) - (setq xref-show-xrefs-function #'consult-xref - xref-show-definitions-function #'consult-xref) - :config - ;; (setq consult-preview-key 'any) - ;; (setq consult-preview-key (kbd "M-p")) - (setq consult-narrow-key "<")) + :after icomplete + :bind (;; C-c bindings (mode-specific-map) + ("C-c h" . consult-history) + ("C-c m" . consult-mode-command) + ("C-c b" . consult-bookmark) + ("C-c k" . consult-kmacro) + ;; C-x bindings (ctl-x-map) + ("C-x M-:" . consult-complex-command) ; orig. repeat-complet-command + ("C-x b" . consult-buffer) ; orig. switch-to-buffer + ("C-x 4 b" . consult-buffer-other-window) ; orig. switch-to-buffer-other-window + ("C-x 5 b" . consult-buffer-other-frame) ; orig. switch-to-buffer-other-frame + ;; Custom M-# bindings for fast register access + ("M-#" . consult-register-load) + ("M-'" . consult-register-store) ; orig. abbrev-prefix-mark (unrelated) + ("C-M-#" . consult-register) + ;; Other custom bindings + ("M-y" . consult-yank-pop) ; orig. yank-pop + (" a" . consult-apropos) ; orig. apropos-command + ;; M-g bindings (goto-map) + ("M-g e" . consult-compile-error) + ("M-g g" . consult-goto-line) ; orig. goto-line + ("M-g M-g" . consult-goto-line) ; orig. goto-line + ("M-g o" . consult-outline) + ("M-g m" . consult-mark) + ("M-g k" . consult-global-mark) + ("M-g i" . consult-imenu) + ("M-g I" . consult-project-imenu) + ;; M-s bindings (search-map) + ("M-s f" . consult-find) + ("M-s L" . consult-locate) + ("M-s g" . consult-grep) + ("M-s G" . consult-git-grep) + ("M-s r" . consult-ripgrep) + ("M-s l" . consult-line) + ("M-s m" . consult-multi-occur) + ("M-s k" . consult-keep-lines) + ("M-s u" . consult-focus-lines) + ;; Isearch integration + ("M-s e" . consult-isearch) + :map isearch-mode-map + ("M-e" . consult-isearch) ; orig. isearch-edit-string + ("M-s e" . consult-isearch) ; orig. isearch-edit-string + ("M-s l" . consult-line)) ; required by consult-line to detect isearch + :init + (setq register-preview-delay 0 + register-preview-function #'consult-register-format) + (advice-add #'register-preview :override #'consult-register-window) + (setq xref-show-xrefs-function #'consult-xref + xref-show-definitions-function #'consult-xref) + :config + ;; (setq consult-preview-key 'any) + ;; (setq consult-preview-key (kbd "M-p")) + (setq consult-narrow-key "<")) + +;; Language: Emacs-Lisp +(setq-default eval-expression-print-length nil ; don't limit print length + eval-expression-print-level nil + ) +;; indent like common lisp +(require 'cl-lib) +(setq-default lisp-indent-function #'common-lisp-indent-function) +(put 'cl-flet 'common-lisp-indent-function + (get 'flet 'common-lisp-indent-function)) +(put 'cl-labels 'common-lisp-indent-function + (get 'labels 'common-lisp-indent-function)) +(put 'if 'common-lisp-indent-function 2) +(put 'dotimes-protect 'common-lisp-indent-function + (get 'when 'common-lisp-indent-function)) -- cgit 1.4.1-21-gabe81