diff options
author | Luke Shumaker <lukeshu@datawire.io> | 2022-11-18 18:36:53 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@datawire.io> | 2022-11-18 18:36:53 -0700 |
commit | 9a62b4a64933f116b08e9e3cb06e013319610e4c (patch) | |
tree | 27bb1b131d5a0d35d34fa31e73f72b2446576dc8 /.config/emacs | |
parent | 9adc8a2aeaf034f5172b32c9bd000c686465ab21 (diff) |
stuff
Diffstat (limited to '.config/emacs')
-rw-r--r-- | .config/emacs/custom.el | 63 | ||||
-rw-r--r-- | .config/emacs/early-init.el | 5 | ||||
-rw-r--r-- | .config/emacs/init.el | 200 | ||||
m--------- | .config/emacs/use-package | 0 | ||||
-rw-r--r-- | .config/emacs/wl.el | 9 |
5 files changed, 203 insertions, 74 deletions
diff --git a/.config/emacs/custom.el b/.config/emacs/custom.el index ef8cdbe..6f7fa36 100644 --- a/.config/emacs/custom.el +++ b/.config/emacs/custom.el @@ -3,43 +3,62 @@ ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. + '(ansi-color-faces-vector + [default default default italic underline success warning error]) + '(auth-source-save-behavior nil) '(erc-nick "lukeshu") '(global-whitespace-mode nil) '(graphviz-dot-auto-indent-on-semi nil) '(package-selected-packages - (quote - (terraform-mode protobuf-mode web-mode outline-magic dockerfile-mode plantuml-mode vue-mode typescript-mode scss-mode php-mode haml-mode coffee-mode yaml-mode nginx-mode meson-mode markdown-mode graphviz-dot-mode go-mode glsl-mode cmake-mode bison-mode bats-mode editorconfig smart-tabs-mode page-break-lines abyss-theme))) + '(adaptive-wrap mmm-mode jq-mode graphql-mode bazel multiple-cursors jq-format terraform-mode protobuf-mode web-mode outline-magic dockerfile-mode plantuml-mode vue-mode typescript-mode scss-mode php-mode haml-mode coffee-mode yaml-mode nginx-mode meson-mode markdown-mode graphviz-dot-mode go-mode glsl-mode cmake-mode bison-mode bats-mode editorconfig smart-tabs-mode page-break-lines abyss-theme)) '(safe-local-variable-values - (quote - ((eval outline-show-all) + '((Indent-tabs-mode) + (c-file-offsets + (block-close . 0) + (brace-list-close . 0) + (brace-list-entry . 0) + (brace-list-intro . +) + (case-label . 0) + (class-close . 0) + (defun-block-intro . +) + (defun-close . 0) + (defun-open . 0) + (else-clause . 0) + (inclass . +) + (label . 0) + (statement . 0) + (statement-block-intro . +) + (statement-case-intro . +) + (statement-cont . +) + (substatement . +) + (topmost-intro . 0)) + (eval outline-show-all) (sgml-basic-offset . 8) (nxml-child-indent . 2) (sentence-end-double-space nil) (Fill-Column . 64) - (eval c-set-offset - (quote arglist-close) - 0) - (eval c-set-offset - (quote arglist-intro) - (quote ++)) - (eval c-set-offset - (quote case-label) - 0) - (eval c-set-offset - (quote statement-case-open) - 0) - (eval c-set-offset - (quote substatement-open) - 0) + (eval c-set-offset 'arglist-close 0) + (eval c-set-offset 'arglist-intro '++) + (eval c-set-offset 'case-label 0) + (eval c-set-offset 'statement-case-open 0) + (eval c-set-offset 'substatement-open 0) (Nginx-indent-tabs-mode) (Nginx-indent-level . 4) (Nginx-indent-level . 8) - (c-set-style . "K&R")))) - '(use-package-verbose (quote debug)) + (c-set-style . "K&R"))) + '(use-package-verbose 'debug) '(yaml-block-literal-electric-alist nil)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. - ) + '(flyspell-incorrect ((t (:background "dark red" :underline (:color "#ef8690" :style wave))))) + '(mmm-cleanup-submode-face ((((class color) (min-colors 89)) :background "#693200"))) + '(mmm-code-submode-face ((((class color) (min-colors 89)) :background "#323232"))) + '(mmm-comment-submode-face ((((class color) (min-colors 89)) :background "#242679"))) + '(mmm-declaration-submode-face ((((class color) (min-colors 89)) :background "#004065"))) + '(mmm-default-submode-face ((((class color) (min-colors 89)) :background "#191a1b"))) + '(mmm-init-submode-face ((((class color) (min-colors 89)) :background "#71206a"))) + '(mmm-output-submode-face ((((class color) (min-colors 89)) :background "#77002a"))) + '(mmm-special-submode-face ((((class color) (min-colors 89)) :background "#00422a")))) diff --git a/.config/emacs/early-init.el b/.config/emacs/early-init.el new file mode 100644 index 0000000..7beda69 --- /dev/null +++ b/.config/emacs/early-init.el @@ -0,0 +1,5 @@ +;; Hey, Emacs: -*- Indent-tabs-mode: nil -*- + +;; Don't automatically initialize package.el, wait for us to configure +;; it in init.el and then manually call (package-initialize). +(setq package-enable-at-startup nil) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 9c46633..5a92f14 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -1,6 +1,9 @@ -;; This config requires Emacs 24.4(+?) ;; Hey, Emacs: -*- Indent-tabs-mode: nil -*- + +;; This config requires Emacs 27. +;; With some differences in package.el initialization it should work with Emacs 24.4(+?). ;; Without (advice-add) it should work in older versions of Emacs 24. + ;;;; Use XDG-ish locations ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (let ((xdg-cache-home (file-name-as-directory (or (getenv "XDG_CACHE_HOME") "~/.cache"))) (xdg-data-home (file-name-as-directory (or (getenv "XDG_DATA_HOME") "~/.local/share")))) @@ -45,39 +48,81 @@ ;;;; Early settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; This isn't particularly important, but set it before doing a whole ;; lot (loading packages), so there isn't a weird change in text size. -(set-face-attribute 'default nil :height 80) +(set-face-attribute 'default nil + :family "DejaVu Sans Mono" + :height 80 + ;:weight 'semi-bold + ) ;;;; Package management ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; package.el -(require 'package) -(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) -(setq package-enable-at-startup nil) -(package-initialize) +(when (require 'package) + (add-to-list 'package-archives + '("melpa-stable" . "https://stable.melpa.org/packages/") t) + (add-to-list 'package-archives + '("melpa" . "http://melpa.org/packages/") t) + ;; Always prefer versions from GNU > Melpa-Stable > Melpa, even if the + ;; later have higher version numbers. + (setq package-archive-priorities + '(("gnu" . 99) + ("melpa-stable" . 5) + ("melpa" . 0))) + (package-initialize)) + ;; use-package.el -(setq use-package-always-ensure t) -(add-to-list 'load-path (concat user-emacs-directory "use-package")) -(require 'use-package) +(eval-when-compile + (add-to-list 'load-path (concat user-emacs-directory "use-package")) + (require 'use-package) + (setq use-package-always-ensure t)) (require 'bind-key) -;; Themes -(use-package abyss-theme - :config (load-theme 'abyss t)) -;; Minor modes -;(use-package dtrt-indent ;; Detect indent style for existing files -; :config (dtrt-indent-mode 1)) -(use-package page-break-lines ;; Display form-feeds pretty - :init (advice-add 'page-break-lines-mode-maybe - :override #'page-break-lines-mode) - :config (global-page-break-lines-mode 1)) -;; (use-package smart-tabs-mode ;; Indent with tabs, align with spaces -;; :config (progn -;; (smart-tabs-mode 1) -;; (apply 'smart-tabs-insinuate -;; (mapcar 'car smart-tabs-insinuate-alist)))) +;; Themes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(use-package modus-themes + :config (progn + ;; Modus makes MMM regions almost impossible to see + (add-hook 'modus-themes-after-load-theme-hook + '(lambda () + (modus-themes-with-colors + (custom-set-faces + `(mmm-cleanup-submode-face ((,class :background ,yellow-refine-bg))) + `(mmm-code-submode-face ((,class :background ,bg-active))) + `(mmm-comment-submode-face ((,class :background ,blue-refine-bg))) + `(mmm-declaration-submode-face ((,class :background ,cyan-refine-bg))) + `(mmm-default-submode-face ((,class :background ,bg-alt))) + `(mmm-init-submode-face ((,class :background ,magenta-refine-bg))) + `(mmm-output-submode-face ((,class :background ,red-refine-bg))) + `(mmm-special-submode-face ((,class :background ,green-refine-bg))))) + )) + ;; Load the theme. Use this function instead of + ;; load-theme in order to get the above hook. + (modus-themes-load-vivendi) + )) + +;; Minor modes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(use-package adaptive-wrap +; :config (progn +; (adaptive-wrap-prefix-mode 1)) + ) (use-package editorconfig - :config (editorconfig-mode 1)) + :config (progn + (editorconfig-mode 1) + (add-to-list 'editorconfig-indentation-alist '(protobuf-mode c-basic-offset)) + (add-to-list 'editorconfig-indentation-alist '(terraform-mode terra-indent-level + terraform-indent-level + hcl-indent-level)) + )) +(use-package jq-format + :commands (jq-format-json-buffer + jq-format-json-region + jq-format-json-on-save-mode + jq-format-jsonlines-buffer + jq-format-jsonlines-region + jq-format-jsonlines-on-save-mode)) +(use-package multiple-cursors + :bind (("C-c m l" . mc/edit-lines) + ("C-c m n" . mc/insert-numbers))) (use-package outline-magic :commands (outline-cycle outline-next-line @@ -85,8 +130,24 @@ outline-move-subtree-down outline-promote outline-demote)) -;; Major modes (non-HTML-related) +(use-package page-break-lines ;; Display form-feeds pretty + :init (advice-add 'page-break-lines-mode-maybe + :override #'page-break-lines-mode) + :config (global-page-break-lines-mode 1)) +(use-package smart-tabs-mode ;; Indent with tabs, align with spaces + :config (progn + (smart-tabs-mode 1) + (apply 'smart-tabs-insinuate + (mapcar 'car smart-tabs-insinuate-alist)))) + +;; Major modes (non-HTML-related) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (use-package bats-mode :mode "\\.bats\\'") +(use-package bazel + :mode (((rx "/" (or "BUILD" "BUILD.bazel") eos) . bazel-build-mode) + ((rx "/" (or "WORKSPACE" "WORKSPACE.bazel") eos) . bazel-workspace-mode) + ((rx "/" (+ nonl) ".bzl" eos) . bazel-starlark-mode) + ((rx "/" (or "bazel.bazelrc" ".bazelrc") eos) . bazelrc-mode) + ((rx "/.bazelignore" eos) . bazelignore-mode))) (use-package bison-mode :mode (("\\.l\\'" . bison-mode) ("\\.y\\'" . bison-mode) @@ -98,12 +159,19 @@ dockerfile-build-no-cache-buffer)) (use-package glsl-mode :mode ("\\.vert\\'" "\\.frag\\'" "\\.geom\\'" "\\.glsl\\'")) (use-package go-mode :mode ("\\.go\\'" "go\\.mod")) +(use-package graphql-mode :mode ("\\.graphql\\'" "\\.gql\\'")) (use-package graphviz-dot-mode :mode ("\\.dot\\'" "\\.gv\\'") :config (add-hook 'graphviz-dot-mode-hook '(lambda () (set (make-local-variable 'graphviz-dot-auto-indent-on-semi) nil) ))) +(use-package jq-mode + :mode "\\.jq\\'" + :interpreter "jq") +(use-package lua-mode + :mode "\\.lua\\'" + :interpreter "lua") (use-package markdown-mode :mode ("\\.markdown\\'" "\\.md\\'" "\\.ronn\\'")) (use-package meson-mode :mode "/meson\\(\\.build\\|_options\\.txt\\)\\'") (use-package nginx-mode :mode ("nginx\\.conf\\'" "/nginx/.+\\.conf\\'")) @@ -116,7 +184,8 @@ (outline-minor-mode t) (set (make-local-variable 'outline-regexp) "[ \t]*[A-Za-z-]") ))) -;; Major modes (HTML-related) + +;; Major modes (HTML-related) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (use-package coffee-mode :mode ("\\.coffee\\'" "\\.iced\\'" @@ -134,25 +203,35 @@ :mode ("\\.php[s345t]?\\'" "/\\.php_cs\\(\\.dist\\)?\\'" "\\.phtml\\'" "/Amkfile\\'" "\\.amk\\'") :interpreter "php\\(?:-?[3457]\\(?:\\.[0-9]+\\)*\\)?") (use-package scss-mode :mode "\\.scss\\'") -(use-package typescript-mode :mode "\\.ts\\'") -(use-package web-mode :mode "\\.html\\'") - -;;(use-package nxhtml) ; nxhtml is invasive, only enable if actively using - -;; IDK? I guess I decided that plain php-mode had improved? -;; -;;(use-package php-mode-improved -;; :mode (("\\.php[s34]?\\'" . php-mode) -;; ("\\.phtml\\'" . php-mode) -;; ("\\.inc\\'" . php-mode)) -;; :config (add-hook 'php-mode-hook -;; '(lambda () -;; (c-set-offset 'cpp-macro 0) -;; ))) +(use-package typescript-mode :mode "\\.tsx?\\'") +(use-package web-mode + :mode ("\\.html\\'" + "\\.vue\\'")) +(use-package mmm-mode + :load mmm-auto + :config (progn + ;; Define the class + (mmm-add-classes + '((js-graphql + :submode graphql-mode + :face mmm-code-submode-face + :front "[^a-zA-Z]graphql`" + :back "`"))) + ;; Add too mmm-mode-ext-classes-alist + (mmm-add-mode-ext-class 'js-mode nil 'js-graphql) + (setq + ;; Enable MMM for modes/files named in + ;; mmm-mode-ext-classes-alist, and only modes/files named + ;; in mmm-mode-ext-classes-alist. + mmm-global-mode 'maybe + ;; 0 = none, 1 = low, 2 = high + mmm-submode-decoration-level 2) + )) +;; Email ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (if (file-exists-p "~/Maildir") - ;;'(apel flim semi wanderlust) (use-package wanderlust + :commands (wl) :config (progn (define-mail-user-agent 'wl-user-agent @@ -264,12 +343,14 @@ sh-script.el is broken." ;; Backup settings (setq - backup-by-copying t ;; don't clobber symlinks - backup-directory-alist '(("." . "~/.cache/emacs/saves")) ;; don't litter my fs tree - delete-old-versions t - kept-new-versions 6 - kept-old-versions 2 - version-control t ;; use versioned backups + backup-by-copying t ;; don't clobber symlinks + backup-directory-alist '(("." . "~/.cache/emacs/saves")) ;; don't litter my fs tree + delete-old-versions t + kept-new-versions 6 + kept-old-versions 2 + version-control t ;; use versioned backups + + create-lockfiles nil ;; don't litter my fs tree ) ;; Web browser settings @@ -356,14 +437,35 @@ sh-script.el is broken." (local-set-key [C-tab] 'hs-toggle-hiding) )) +(add-hook 'python-mode-hook + (lambda () + (hs-minor-mode t) + (local-set-key [C-tab] 'hs-toggle-hiding) + )) + (add-hook 'outline-minor-mode-hook (lambda () (define-key outline-minor-mode-map [C-tab] 'outline-cycle))) +(add-hook 'web-mode-hook + (lambda () + (setq web-mode-enable-auto-closing nil) + (setq web-mode-enable-auto-pairing nil) + (setq web-mode-enable-auto-opening nil) + (setq web-mode-enable-auto-quoting nil) + (setq web-mode-enable-auto-expanding nil) + (setq web-mode-enable-auto-indentation nil) + )) + (add-to-list 'auto-mode-alist '("PKGBUILD" . sh-mode)) (add-to-list 'auto-mode-alist '("SRCBUILD" . sh-mode)) (add-to-list 'auto-mode-alist '("\\.mak\\'" . makefile-gmake-mode)) (add-to-list 'auto-mode-alist '("\\.jad\\'" . java-mode)) +(add-to-list 'auto-mode-alist '("\\.schema\\'" . js-mode)) + +(eval-when-compile + (add-to-list 'load-path (concat user-emacs-directory "go-template-mode")) + (require 'go-template-mode)) ;; Anything that gets magically appended ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/.config/emacs/use-package b/.config/emacs/use-package new file mode 160000 +Subproject a7422fb8ab1baee19adb2717b5b47b9c3812a84 diff --git a/.config/emacs/wl.el b/.config/emacs/wl.el index deefef9..fce75c1 100644 --- a/.config/emacs/wl.el +++ b/.config/emacs/wl.el @@ -6,8 +6,7 @@ (setq ;; Misc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; wl-local-domain "lan.lukeshu.com" - wl-icon-directory "~/.emacs.d/el-get/wanderlust/icons" - wl-message-id-domain user-mail-address + wl-message-id-domain user-mail-address ;; Network ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; This only deals with sending--I use offlineimap to fetch @@ -15,6 +14,10 @@ ;; Folders/File system ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; elmo-maildir-folder-path "~/Maildir" ;; where I store my mail + elmo-localdir-folder-path "~/Maildir.MH" ;; I don't use MH, but ELMO needs to use it internally? + wl-temporary-file-directory (file-name-as-directory (or (getenv "XDG_RUNTIME_DIR") + (getenv "TMPDIR") + ("/tmp"))) ;; note: all below are dirs (Maildirs) under elmo-maildir-folder-path ;; the '.'-prefix is for marking them as maildirs @@ -50,7 +53,7 @@ wl-message-visible-field-list (mapcar (lambda (str) ;; but then display these (apply 'concat (mapcar (lambda (c) (if (and (<= ?a c) (<= c ?z)) - (list ?[ c (upcase c) ?]) + (list ?\[ c (upcase c) ?\]) (list c))) str))) '( |