From bd1e808c646a01fd91be75fb0d80e38b1def976f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 13 Nov 2020 15:23:18 -0600 Subject: Correct typo --- config.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.org b/config.org index 36fb0da..287da8b 100644 --- a/config.org +++ b/config.org @@ -678,7 +678,7 @@ I was using company, but I think it might've been causing issues with ~awk-mode~ *** Lisp (SLIME) #+begin_src emacs-lisp (use-package slime - :when (exectuable-find "sbcl") + :when (executable-find "sbcl") :custom (inferior-lisp-program "sbcl") (slime-contribs '(slime-fancy)) -- cgit 1.4.1-21-gabe81 From 5244a55fd6a1be107acbad2c29111c60c00a8d37 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 13 Nov 2020 15:23:39 -0600 Subject: Comment circe; add+comment elfeed --- config.org | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 114 insertions(+), 3 deletions(-) diff --git a/config.org b/config.org index 287da8b..e24c88c 100644 --- a/config.org +++ b/config.org @@ -801,21 +801,132 @@ I was using company, but I think it might've been causing issues with ~awk-mode~ (nov-mode . visual-line-mode) (nov-mode . visual-fill-column-mode)) #+end_src +** Circe: IRC +Commented for now while I figure out exactly what I want from IRC, et al. +#+begin_src emacs-lisp + ;; (cuss auth-sources '("~/.authinfo")) + + ;; (defun acdw/fetch-password (&rest params) + ;; (require 'auth-source) + ;; (let ((match (car (apply 'auth-source-search params)))) + ;; (if match + ;; (let ((secret (plist-get match :secret))) + ;; (if (functionp secret) + ;; (funcall secret) + ;; secret)) + ;; (error "Password not found for %S" params)))) + + ;; (defun acdw/nickserv-password (nick server) + ;; (acdw/fetch-password :login nick :machine server)) + + ;; (defun acdw/setup-lui () + ;; (interactive) + ;; (setq right-margin-width 5) + ;; (setq fringes-outside-margins t) + ;; (setq word-wrap t) + ;; (setq wrap-prefix " ") + ;; (setf (cdr (assoc 'continuation fringe-indicator-alist)) nil)) + + ;; (defun acdw/circe-prompt () + ;; (lui-set-prompt + ;; (concat (propertize (concat (buffer-name) ">") + ;; 'face 'circe-prompt-face) + ;; " "))) + + ;; (use-package circe + ;; :init + ;; (defun acdw/setup-circe () + ;; (whitespace-mode -1) + ;; (enable-lui-autopaste)) + ;; :custom + ;; (circe-default-part-message "Peace out, cub scouts") + ;; (circe-default-quit-message "See You Space Cowpokes....") + ;; (circe-default-realname "Case") + ;; (circe-highlight-nick-type 'all) + ;; (circe-reduce-lurker-spam t) + ;; (circe-format-say "{nick:-15s}| {body}") + ;; (circe-format-self-say "{nick:-15s}> {body}") + ;; (circe-format-action " * {nick} {body}") + ;; (circe-format-message " *{nick}* {body}") + ;; (circe-format-message-action " * *{nick}* {body}") + ;; (circe-format-self-action " * {nick} {body}") + ;; (circe-use-cycle-completion t) + ;; (circe-channel-killed-confirmation nil) + ;; (circe-color-nicks-everywhere t) + ;; (circe-default-nick "acdw") + ;; (circe-default-user "acdw") + ;; (circe-server-auto-join-default-type :after-auth) + ;; (lui-time-stamp-position 'right-margin) + ;; (lui-fill-type nil) + ;; (lui-time-stamp-format "%H:%M") + ;; (lui-track-bar-behavior 'before-switch-to-buffer) + ;; (circe-network-options + ;; `(("Freenode" + ;; :tls t + ;; :host "irc.acdw.net" + ;; :port 16789 + ;; :nick "acdw" + ;; :sasl-username "acdw" + ;; :sasl-password "freenode:purple-mountains-majesty" + ;; :channels ("#emacs")) + ;; ("Tilde.chat" + ;; :tls t + ;; :host "irc.acdw.net" + ;; :port 16789 + ;; :nick "acdw" + ;; :sasl-username "acdw" + ;; :sasl-password "tilde.chat:purple-mountains-majesty" + ;; :channels ("#gemini" "#meta" "#team" "#bread")))) + ;; :custom-face + ;; (circe-highlight-nick-face ((t (:inherit bold)))) + ;; (circe-originator-face ((t (:weight bold)))) + ;; (circe-prompt-face ((t (:foreground "blue")))) + ;; (lui-time-stamp-face ((t (:foreground "#808080" :height 0.8)))) + ;; :config + ;; (enable-lui-track-bar) + ;; (enable-circe-color-nicks) + ;; (enable-circe-display-images) + ;; :hook + ;; (circe-channel-mode . acdw/setup-circe) + ;; (circe-chat-mode . acdw/circe-prompt) + ;; (lui-mode . acdw/setup-lui)) +#+end_src +** Elfeed: Feed reader +Elfeed keeps freezing emacs. I'm commenting this for now. +#+begin_src emacs-lisp + ;; (use-package elfeed + ;; :custom + ;; (elfeed-feeds + ;; '(("https://acdw.net/atom.xml" me) + ;; ("https://planet.emacslife.com/atom.xml" emacs programming blog) + ;; ("https://www.xkcd.com/rss.xml" comics) + ;; ("https://portal.mozz.us/gemini/breadpunk.club/~bakersdozen/gemlog/atom.xml" friends) + ;; ("https://kotobank.ch/~vaartis/rss.xml" friends) + ;; ("https://m455.casa/feed.rss" friends) + ;; ("https://eli.li/feed.rss" friends) + ;; ("http://len.falken.ink/" friends) + ;; ("https://cadence.moe/blog/atom.xml?limit=30" friends) + ;; ("https://benjaminwil.info/feed.xml" friends) + ;; ("https://www.5snb.club/rss.xml" friends) + ;; ("https://write.lain.faith/@/haskal/atom.xml" friends) + ;; ("https://p1k3.com/feed" friends) + ;; ))) +#+end_src * Machine-specific configurations #+begin_src emacs-lisp (use-package su :when *acdw/at-home* :config (su-mode 1)) - + (use-package trashed :when *acdw/at-home* :custom (delete-by-moving-to-trash t)) - + (use-package exec-path-from-shell :when *acdw/at-home* :demand :config - (exec-path-from-shell-initialize))) + (exec-path-from-shell-initialize)) #+end_src -- cgit 1.4.1-21-gabe81 From 7708e7e17d09f4c86cc27762056bfe2a8012dc46 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 13 Nov 2020 15:23:52 -0600 Subject: Add bookmark --- var/elpher-bookmarks.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/var/elpher-bookmarks.el b/var/elpher-bookmarks.el index 343d81a..08987d0 100644 --- a/var/elpher-bookmarks.el +++ b/var/elpher-bookmarks.el @@ -4,7 +4,8 @@ ; Feel free to edit by hand, but take care to ensure ; the list structure remains intact. -(("cosmic voyage" "gemini://cosmic.voyage/") +(("weechat relay" "gemini://low-key.me/guides/weechat_irc_relay.gmi") + ("cosmic voyage" "gemini://cosmic.voyage/") ("kayw" "gemini://salejandro.me/") ("gem.acdw.net" "gemini://gem.acdw.net/") ("Spacewalk" "gemini://rawtext.club/~sloum/spacewalk.gmi") -- cgit 1.4.1-21-gabe81 From bc2914e5c98f92da2c485843b4dafe6e587abeb4 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 17 Nov 2020 22:58:37 -0600 Subject: Change font --- config.org | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config.org b/config.org index e24c88c..c3474ae 100644 --- a/config.org +++ b/config.org @@ -355,20 +355,20 @@ I'm sure there's a better way to do this, but for now, this is the best I've got ("Sans Serif" "helv" "helvetica" "arial" "fixed") ("helv" "helvetica" "arial" "fixed") ;; now mine - ("FixedPitch" "Go Mono" "DejaVu Sans Mono" "Consolas" "fixed") - ("VariablePitch" "Spectral Medium" "Go" "DejaVu Sans" "Georgia" "fixed"))) + ("FixedPitch" "Agave" "Go Mono" "DejaVu Sans Mono" "Consolas" "fixed") + ("VariablePitch" "Comic Neue" "Spectral Medium" "Go" "DejaVu Sans" "Georgia" "fixed"))) (set-face-attribute 'default nil :family "FixedPitch" - :height 110) + :height 160) (set-face-attribute 'fixed-pitch nil :family "FixedPitch" - :height 110) + :height 160) (set-face-attribute 'variable-pitch nil :family "VariablePitch" - :height 135) + :height 180) #+END_SRC *** Ligatures These cause big problems with cc-mode (as in, totally freezing everything), so I'm going to comment it out. -- cgit 1.4.1-21-gabe81 From 96d13912120005fbf7db5378f317a79bda4aaab0 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 17 Nov 2020 22:59:06 -0600 Subject: Don't auto-load slime-mode --- config.org | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/config.org b/config.org index c3474ae..1b383f0 100644 --- a/config.org +++ b/config.org @@ -677,13 +677,14 @@ I was using company, but I think it might've been causing issues with ~awk-mode~ #+end_src *** Lisp (SLIME) #+begin_src emacs-lisp - (use-package slime - :when (executable-find "sbcl") - :custom - (inferior-lisp-program "sbcl") - (slime-contribs '(slime-fancy)) - :config - (load (expand-file-name "~/.quicklisp/slime-helper.el"))) + (use-package slime + :when (executable-find "sbcl") + :custom + (inferior-lisp-program "sbcl") + (slime-contribs '(slime-fancy)) + ;;:config + ;;(load (expand-file-name "~/.quicklisp/slime-helper.el")) + ) #+end_src * Writing ** Word count -- cgit 1.4.1-21-gabe81 From 4e80564444f41440c5f76c0585214adf10171ce6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 19 Nov 2020 20:20:00 -0600 Subject: Change fonts back. They are silly. --- config.org | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config.org b/config.org index 1b383f0..493406c 100644 --- a/config.org +++ b/config.org @@ -355,20 +355,20 @@ I'm sure there's a better way to do this, but for now, this is the best I've got ("Sans Serif" "helv" "helvetica" "arial" "fixed") ("helv" "helvetica" "arial" "fixed") ;; now mine - ("FixedPitch" "Agave" "Go Mono" "DejaVu Sans Mono" "Consolas" "fixed") - ("VariablePitch" "Comic Neue" "Spectral Medium" "Go" "DejaVu Sans" "Georgia" "fixed"))) + ("FixedPitch" "Go Mono" "DejaVu Sans Mono" "Consolas" "fixed") + ("VariablePitch" "Go" "DejaVu Sans" "Georgia" "fixed"))) (set-face-attribute 'default nil :family "FixedPitch" - :height 160) + :height 140) (set-face-attribute 'fixed-pitch nil :family "FixedPitch" - :height 160) + :height 140) (set-face-attribute 'variable-pitch nil :family "VariablePitch" - :height 180) + :height 150) #+END_SRC *** Ligatures These cause big problems with cc-mode (as in, totally freezing everything), so I'm going to comment it out. -- cgit 1.4.1-21-gabe81 From b13434ce36a86c337198bcf14b78108508830b95 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 19 Nov 2020 20:20:12 -0600 Subject: Add bookmark --- var/elpher-bookmarks.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/var/elpher-bookmarks.el b/var/elpher-bookmarks.el index 08987d0..5fdbf57 100644 --- a/var/elpher-bookmarks.el +++ b/var/elpher-bookmarks.el @@ -4,7 +4,8 @@ ; Feel free to edit by hand, but take care to ensure ; the list structure remains intact. -(("weechat relay" "gemini://low-key.me/guides/weechat_irc_relay.gmi") +(("gemini://breadpunk.club" "gemini://breadpunk.club/") + ("weechat relay" "gemini://low-key.me/guides/weechat_irc_relay.gmi") ("cosmic voyage" "gemini://cosmic.voyage/") ("kayw" "gemini://salejandro.me/") ("gem.acdw.net" "gemini://gem.acdw.net/") -- cgit 1.4.1-21-gabe81 From c337731cdc04d832594e395462e57aef3b8dd8af Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 21 Nov 2020 10:07:18 -0600 Subject: 1.5 bankruptcy --- config.org | 1022 +++++++++++------------------------------------------------- 1 file changed, 181 insertions(+), 841 deletions(-) diff --git a/config.org b/config.org index 493406c..a1bd3e6 100644 --- a/config.org +++ b/config.org @@ -1,20 +1,42 @@ #+TITLE: Emacs config #+AUTHOR: Case Duckworth +# -*- encoding: utf-8-unix -*- #+BABEL: :cache yes #+PROPERTY: header-args :tangle init.el #+OPTIONS: toc:nil -#+BANKRUPTCY_COUNT: 1 +#+BANKRUPTCY_COUNT: 1.5 * Preamble -I wanted to write my Emacs configuration in [[https://orgmode.org][Org mode]] for a while, but never could quite figure out how. Finally, I found [[https://github.com/larstvei/dot-emacs][Lars Tveito]]'s config, which does exactly what I want: =init.el= is small and simple, and replaced after the first run, and =init.org= is automatically tangled. So I'm very excited. +** Inspiration + +I've been inspired by [[https://github.com/larstvei/dot-emacs][Lars Tveito]]'s config, which does exactly what I +want: =init.el= is small and simple, and is replaced after the first +run by the tangled contents of this file -- =config.org= -- which is +furthermore automatically tangled. + +** Problems with this setup + ++ While =config.org= automatically tangles, I can't run =(load-file + init.el)= -- it results in an endless loop for some reason. I might + need to look into a hook of some kind. * License Copyright © 2020 Case Duckworth -This work is free. You can redistribute it and/or modify it under the -terms of the Do What The Fuck You Want To Public License, Version 2, -as published by Sam Hocevar. See the LICENSE file, or below, for more details. + +This work is free. You can redistribute it and/or modify it under the +terms of the Do What the Fuck You Want To Public License, Version 2, +as published by Sam Hocevar. See the LICENSE file, or below, for more +details. + +NOTE: the WTFPL is probably (most definitely!) not compatible with GNU +Emacs's license, and I'm not sure, though I'm pretty confident, that +my =config.org= would be classified as a /derivative work/ under those +terms. Therefore, me licensing my =config.org= under the WTFPL is at +best, unenforceable, and at worst, downright in violation of the GPL. + +SUE ME, RMS !!! #+begin_src text :tangle LICENSE DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE @@ -32,147 +54,187 @@ as published by Sam Hocevar. See the LICENSE file, or below, for more details. 0. You just DO WHAT THE FUCK YOU WANT TO. - #+end_src -Probably that's not legal under the terms of the GPL or whatever Emacs is licensed under. -SUE ME, RMS - * Bootstrap -/Check out Lars's config for the reasoning behind this./ - -When this configuration is loaded for the first time, this ~init.el~ is loaded: +When this configuration is loaded for the first time, /this/ =init.el= +is loaded: -#+BEGIN_SRC emacs-lisp :tangle no - ;; This file replaces itself with the actual configuration when first run. To keep only this version in git, run this command: +#+begin_src emacs-lisp :tangle no + ;; This file replaces itself with the actual configuration when first + ;; run. To keep only this version tracked by git, run the command + ;; ;; git update-index --assume-unchanged init.el ;; - ;; If it needs to be changed, start tracking it again thusly: + ;; If it needs to be changed, start tracking it again with the command + ;; ;; git update-index --no-assume-unchanged init.el - + ;; + ;; edit as needed, and run the first command again. (require 'org) - (find-file (concat user-emacs-directory "init.org")) + (find-file (concat user-emacs-directory "config.org")) (org-babel-tangle) - (load-file (concat user-emacs-directory "early-init.el")) - (load-file (concat user-emacs-directory "init.el")) - (byte-compile-file (concat user-emacs-directory "init.el")) -#+END_SRC + (load-file (concat-user-emacs-directory "early-init.el")) + (load-file (concat-user-emacs-directory "init.el")) +#+end_src ** Tangling -After the first run, the above ~init.el~ will be replaced by the tangled stuff here. However, when /this/ file is edited, we'll need to re-tangle everything. However, nobody has time to do that manually with =C-c C-v t=, /every time/! Luckily, Emacs is highly programmable. + +After first running Emacs with this config, the above snippet will be +replaced by the result of tangling this file. However, when we edit +=config.org=, we'll need to retangle it. The default keybinding to +tangle is =C-c C-v t=, which takes a while and is easy to forget. So +let's automatically tangle =config.org= on save. #+NAME: tangle-on-save -#+BEGIN_SRC emacs-lisp :tangle no +#+begin_src emacs-lisp + ;;; init.el -*- lexical-binding: t; coding: utf-8-unix -*- (defun acdw/tangle-init () - "If the current buffer is `init.org', the code blocks are tangled, - and the tangled file is compiled and loaded." + "If the current buffer is `config.org', the code blocks are + tangled, and the tangled file is compiled and loaded." (interactive) - (when (equal (buffer-file-name) - (expand-file-name - (concat user-emacs-directory "config.org"))) - ;; Now with async! - (require 'async) - (async-start - `(lambda () - ;; Avoid running hooks when tangling. - (let ((prog-mode-hook nil)) - (require 'org) - (org-babel-tangle-file - (expand-file-name - (concat user-emacs-directory "config.org"))))) - (lambda (_) - (message "Tangle complete."))))) - + (let (config-org (expand-file-name + (concat user-emacs-directory "config.org"))) + (when (equal (buffer-file-name) config-org) + (require 'async) + (async-start + `(lambda () + ;; Avoid running hooks when tangling. + (let ((prog-mode-hook nil)) + (require 'org) + (org-babel-tangle-file config-org))) + (lambda (_) + (message "Tangle complete.")))))) + + ;; Add a hook to tangle config.org. (add-hook 'after-save-hook #'acdw/tangle-init) -#+END_SRC +#+end_src * Early initiation -Emacs 27.1+ uses ~early-init.el~, which is evaluated before things like ~package.el~ and other stuff. So I have a few settings in there. -** Preamble -Of course, first thing is the modeline. After that, I set ~load-prefer-newer~ because, well, it /should/. -#+BEGIN_SRC emacs-lisp :tangle early-init.el - ;;; early-init.el -*- lexical-binding: t; no-byte-compile: t -*- - -(setq load-prefer-newer t) -#+END_SRC - -** Computers -I have to set these constants before bootstrapping the package manager, since ~straight.el~ depends on Git, and at work, those are in a weird place. +Emacs 27.1+ uses =early-init.el= /in addition to/ =init.el=, mostly +for settings related to packags. Since I use =straight.el= for +package management, I need to specify that in this file. -#+BEGIN_SRC emacs-lisp :tangle early-init.el - (defconst *acdw/at-work* (eq system-type 'windows-nt)) - (defconst *acdw/at-larry* (string= (system-name) "larry")) - (defconst *acdw/at-bax* (string= (system-name) "bax")) - (defconst *acdw/at-home* (or *acdw/at-larry* *acdw/at-bax*)) -#+END_SRC +#+begin_src emacs-lisp :tangle early-init.el + ;;; early-init.el -*- lexical-binding: t; no-byte-compile: t -*- + ;; DO NOT EDIT THIS FILE BY HAND. Edit =config.org= instead! -** Package management - I've started using straight.el, which is great. It grabs packages from git, and apparently will let me fork and edit them, which I'll probably get around to ... eventually. + (setq load-prefer-newer t) -*** At work, Git's in a weird place -#+BEGIN_SRC emacs-lisp :tangle early-init.el - (when *acdw/at-work* + (when (eq system-type 'windows-nt) ; I'm at work (add-to-list 'exec-path "~/bin") - (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin")) -#+END_SRC + (add-to-list 'exec-path + "C:/Users/aduckworth/Downloads/PortableGit/bin")) -*** [[https://github.com/raxod502/straight.el][straight.el]] -I don't know why, but for some reason the bootstrapping doesn't work on Windows. I have to download the repo directly from github and put it in the right place (=~/.emacs.d/straight/repos/straight.el/=). + ;; This DOES NOT WORK on Windows. + ;; Download the repo directly from Github and unzip it into + ;; ~/.emacs.d/straight/repos/straight.el. -#+BEGIN_SRC emacs-lisp :tangle early-init.el (defvar bootstrap-version) (let ((bootstrap-file - (expand-file-name "straight/repos/straight.el/bootstrap.el" - user-emacs-directory)) - (bootstrap-version 5)) + (expand-file-name "straight/repos/straight.el/bootstrap.el" + user-emacs-directory)) + (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer - (url-retrieve-synchronously - "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" - 'silent 'inhibit-cookies) - (goto-char (point-max)) - (eval-print-last-sexp))) + (url-retrieve-synchronously + "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) -#+END_SRC -*** [[https://github.com/jwiegley/use-package][use-package]] -Yeah, you know it, I know it, we all love it. It's use-package. -#+BEGIN_SRC emacs-lisp :tangle early-init.el + ;; Use-package + (setq straight-use-package-by-default t) (straight-use-package 'use-package) -#+END_SRC -* Begin init.el -#+BEGIN_SRC emacs-lisp :noweb tangle - ;;; init.el -*- lexical-binding: t; coding: utf-8 -*- - <> -#+END_SRC + + ;; Use-package extra keywords + + (use-package use-package-custom-update + :straight (use-package-custom-update + :host github + :repo "a13/use-package-custom-update")) + +#+end_src + * Macros + ** cuss -I like ~use-package~, but I don't like doing the weird "pseudo-package" stuff a lot of people do in their emacs configs. Partially because I have to set ~:straight nil~ on a lot of built-in packages, but also because I think being /that/ obsessive over one interface through the whole config is ... I don't know, short-sighted? -Either way, I /do/ like the ~:custom~ interface that ~use-package~ has, so I've re-implemented it in my own macro. This way I don't have to worry about whether to ~setq~ or ~custom-set-variable~ or whatever. Just ~cuss~! -#+BEGIN_SRC emacs-lisp +I like =use-package= a lot, but I don't like the weird +"pseudo-package" things you see with a lot of =use-package= setups +around the Internet. They're cludgy, they /don't/ actually, in my +opinion anyway, make the config any easier to read (how am I supposed +to know what options are in =mule=, for example?!), and most +importantly, =straight.el= doesn't really like them that much. + +*However*, I really like the =:custom= keyword in =use-package=, + enough to implement it as my own macro. =cuss= will automagically + call =custom-set-variable= or =setq=, whichever is best for the + variable being tweaked. I pulled this straight from =use-package=, + so I /know/ it works! :P + +#+begin_src emacs-lisp (defmacro cuss (var val) - "Basically `use-package''s `:custom', but without either." + "Basically the `:custom' macro from `use-package', by itself." `(progn (funcall (or (get ',var 'custom-set) #'set-default) - ',var ,val))) -#+END_SRC + ',var ,val))) +;;; test +#+end_src + +* Machines + +I use Emacs on a couple of different computers: my two at home, and +assorted Windows machines at work. I define a couple of constants to +easily keep track of which computer I'm using. + +#+begin_src emacs-lisp + (defconst *acdw/at-work* (eq system-type 'windows-nt)) + + (defconst *acdw/at-larry* (string= (system-name) "larry")) + (defconst *acdw/at-bax* (string= (system-name) "bax")) + (defconst *acdw/at-home* (or *acdw/at-larry* *acdw/at-bax*)) +#+end_src + * Files -** [[https://github.com/emacscollective/no-littering][Keep .emacs.d tidy]] -#+BEGIN_SRC emacs-lisp - (straight-use-package 'no-littering) - (require 'no-littering) -#+END_SRC + +** Keep .emacs.d tidy + + By default, Emacs keeps files all over the damn place. I like the + =no-littering= package to keep files in one of two directories -- + =etc/= and =var/=. I'm going to require it right away so that I can + immediately use it. + + #+begin_src emacs-lisp + (use-package no-littering) + (require 'no-littering) + #+end_src + ** Customize -I don't like the customize interface, but I still sometimes use it when I'm not sure what the name of a variable is. So I save the stuff to a file, I just don't load it or keep track of it. -#+BEGIN_SRC emacs-lisp + +I don't use the customize interface -- but sometimes it's good to +figure out what settings are available for a package. So I keep the +customizations in a file (some people just throw it in =/dev/null=), +but I /don't/ load the file. + +#+begin_src emacs-lisp (cuss custom-file (no-littering-expand-etc-file-name "custom.el")) -#+END_SRC +#+end_src + ** Encoding -#+BEGIN_SRC emacs-lisp + +It's 2020 -- let's use UTF-8 everywhere. Furthermore, even Notepad +can figure out Unix line endings (=LF=) -- so let's only use that. + +I'm going to be perfectly honest here. I'm not sure what like, any of +these do. I just threw everything =utf-8-unix= into a block and hope +for the best. + +#+begin_src emacs-lisp (prefer-coding-system 'utf-8-unix) (set-default-coding-systems 'utf-8-unix) (set-terminal-coding-system 'utf-8-unix) @@ -181,753 +243,31 @@ I don't like the customize interface, but I still sometimes use it when I'm not (set-file-name-coding-system 'utf-8-unix) (set-clipboard-coding-system 'utf-8-unix) (set-buffer-file-coding-system 'utf-8-unix) - (cuss locale-coding-system 'utf-8) + (cuss locale-coding-system 'utf-8-unix) (cuss x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) -#+END_SRC -** Recent files -#+BEGIN_SRC emacs-lisp - (use-package recentf - :config - (add-to-list 'recentf-exclude no-littering-var-directory) - (add-to-list 'recentf-exclude no-littering-etc-directory) - :custom - (recentf-max-menu-items 100) - (recentf-max-saved-items 100) - :config - (recentf-mode 1)) -#+END_SRC -** Backups -#+BEGIN_SRC emacs-lisp - (cuss backup-directory-alist - `((".*" . ,(no-littering-expand-var-file-name "backup/")))) -#+END_SRC -** [[https://github.com/bbatsov/super-save][Autosave]] -#+BEGIN_SRC emacs-lisp - (use-package super-save - :custom - (auto-save-default nil) - (super-save-exclude '(".gpg")) - :config - (super-save-mode 1)) -#+END_SRC -** [[https://www.emacswiki.org/emacs/SavePlace][Save places]] -#+BEGIN_SRC emacs-lisp - (use-package saveplace - :custom - (save-place-file (no-littering-expand-var-file-name "places")) - (save-place-forget-unreadable-files (not *acdw/at-work*)) - :config - (save-place-mode 1)) -#+END_SRC -** [[https://www.emacswiki.org/emacs/SaveHist][Save history]] -#+BEGIN_SRC emacs-lisp - (use-package savehist - :custom - (savehist-addtional-variables - '(kill-ring - search-ring - regexp-search-ring)) - (savehist-save-minibuffer-history t) - :config - (savehist-mode 1)) -#+END_SRC -* User interface -** Look -*** Frames and windows -**** Frame defaults -#+BEGIN_SRC emacs-lisp - (cuss default-frame-alist '((tool-bar-lines . 0) - (menu-bar-lines . 0) - (vertical-scroll-bars . nil) - (horizontal-scroll-bars . nil) - (right-divider-width . 2) - (bottom-divider-width . 2) - (left-fringe-width . 2) - (right-fringe-width . 2))) - - ;; also disable these with modes, so I can re-enable them more easily - (menu-bar-mode -1) - (tool-bar-mode -1) - (scroll-bar-mode -1) -#+END_SRC -**** Resizing -#+BEGIN_SRC emacs-lisp - (cuss frame-resize-pixelwise t) - (cuss window-combination-resize t) -#+END_SRC -*** Buffers -#+BEGIN_SRC emacs-lisp - (cuss uniquify-buffer-name-style 'forward) - - (cuss indicate-buffer-boundaries - '((top . right) - (bottom . right) - (t . nil))) -#+END_SRC -**** Startup buffer -#+BEGIN_SRC emacs-lisp - (cuss inhibit-startup-buffer-menu t) - (cuss inhibit-startup-screen t) - (cuss initial-buffer-choice t) ; start in *scratch* - (cuss initial-scratch-message nil) -#+END_SRC -*** Cursor -#+BEGIN_SRC emacs-lisp - (cuss cursor-type 'bar) - (cuss cursor-in-non-selected-windows 'hollow) - (blink-cursor-mode 0) -#+END_SRC -*** Interactivity -**** Mouse -#+BEGIN_SRC emacs-lisp - (cuss mouse-yank-at-point t) -#+END_SRC -**** Dialogs -#+BEGIN_SRC emacs-lisp - (cuss use-dialog-box nil) -#+END_SRC -**** Disabled functions -#+BEGIN_SRC emacs-lisp - (cuss disabled-command-function nil) -#+END_SRC -**** Function aliases -#+begin_src emacs-lisp - (fset 'yes-or-no-p #'y-or-n-p) -#+end_src -*** Miscellaneous -**** Convert =^L= to a line -#+begin_src emacs-lisp - (use-package form-feed - :hook - ((text-mode prog-mode) . form-feed-mode)) #+end_src -** Themes: [[https://github.com/protesilaos/modus-themes][Modus]] -#+BEGIN_SRC emacs-lisp - (use-package modus-operandi-theme) - (use-package modus-vivendi-theme) -#+END_SRC -*** [[https://github.com/hadronzoo/theme-changer][Change themes]] based on time of day -#+BEGIN_SRC emacs-lisp - (use-package theme-changer - :init - (setq calendar-location-name "Baton Rouge, LA" - calendar-latitude 30.39 - calendar-longitude -91.83) - :config - (change-theme 'modus-operandi 'modus-vivendi)) -#+END_SRC -*** Disable the current theme when a theme is interactively loaded -This doesn't happen often, but I'll be ready when it does. -#+begin_src emacs-lisp - (defadvice load-theme - (before disable-before-load (theme &optional no-confirm no-enable) activate) - (mapc 'disable-theme custom-enabled-themes)) -#+end_src -** Modeline: [[https://github.com/Malabarba/smart-mode-line][smart-mode-line]] -#+BEGIN_SRC emacs-lisp - (use-package smart-mode-line - :config - (sml/setup)) -#+END_SRC -I hide all minor-modes by default for a clean modeline. However, I can add them back by adding them to the whitelist with ~(add-to-list 'rm-whitelist " REGEX")~. -#+BEGIN_SRC emacs-lisp - (defun rm-whitelist-add (regexp) - "Add a regexp to the whitelist." - (add-to-list 'rm--whitelist-regexps regexp) - (setq rm-whitelist - (mapconcat 'identity rm--whitelist-regexps "\\|"))) +** Recent files - (setq rm--whitelist-regexps '("^$")) +Though I haven't used this feature ... yet, maybe if I use the =C-x +C-r= binding that is suggested (like /everywhere/), it'll be easier +for me to use. - (use-package rich-minority - :custom - (rm-whitelist - (mapconcat 'identity rm--whitelist-regexps "\\|"))) -#+END_SRC -** Fonts -I'm sure there's a better way to do this, but for now, this is the best I've got. I append to the ~face-font-family-alternatives~ because I don't know what kind of weird magic they're doing in there. -#+BEGIN_SRC emacs-lisp - (cuss face-font-family-alternatives - '(("Monospace" "courier" "fixed") - ("Monospace Serif" "Courier 10 Pitch" "Consolas" "Courier Std" "FreeMono" "Nimbus Mono L" "courier" "fixed") - ("courier" "CMU Typewriter Text" "fixed") - ("Sans Serif" "helv" "helvetica" "arial" "fixed") - ("helv" "helvetica" "arial" "fixed") - ;; now mine - ("FixedPitch" "Go Mono" "DejaVu Sans Mono" "Consolas" "fixed") - ("VariablePitch" "Go" "DejaVu Sans" "Georgia" "fixed"))) - - (set-face-attribute 'default nil - :family "FixedPitch" - :height 140) - - (set-face-attribute 'fixed-pitch nil - :family "FixedPitch" - :height 140) - - (set-face-attribute 'variable-pitch nil - :family "VariablePitch" - :height 150) -#+END_SRC -*** Ligatures -These cause big problems with cc-mode (as in, totally freezing everything), so I'm going to comment it out. -#+begin_src emacs-lisp - ;; (use-package ligature - ;; :straight (ligature - ;; :host github - ;; :repo "mickeynp/ligature.el") - ;; :config - ;; (ligature-set-ligatures 'prog-mode - ;; '("++" "--" "/=" "&&" "||" "||=" - ;; "->" "=>" "::" "__" - ;; "==" "===" "!=" "=/=" "!==" - ;; "<=" ">=" "<=>" - ;; "/*" "*/" "//" "///" - ;; "\\n" "\\\\" - ;; "<<" "<<<" "<<=" ">>" ">>>" ">>=" - ;; "|=" "^=" - ;; "**" "--" "---" "----" "-----" - ;; "==" "===" "====" "=====" - ;; "" "-->" "/>" - ;; ":=" "..." ":>" ":<" ">:" "<:" - ;; "::=" ;; add others here - ;; )) - ;; :config - ;; (global-ligature-mode)) -#+end_src -*** [[https://github.com/rolandwalker/unicode-fonts][Unicode fonts]] -#+BEGIN_SRC emacs-lisp - (use-package persistent-soft) +I'm putting =recentf= in a =use-package= declaration, by the way, +because even though it's a part of Emacs, it's conveniently in its own +package. - (use-package unicode-fonts - :after persistent-soft - :config - (unicode-fonts-setup)) - -#+END_SRC -* Editing -** Completion -I was using company, but I think it might've been causing issues with ~awk-mode~, so I'm trying ~hippie-mode~ right now. So far, I'm also enjoying not having a popup all the time. -#+BEGIN_SRC emacs-lisp - (bind-key "M-/" #'hippie-expand) -#+END_SRC -** Ignore case -#+BEGIN_SRC emacs-lisp - (cuss completion-ignore-case t) - (cuss read-buffer-completion-ignore-case t) - (cuss read-file-name-completion-ignore-case t) -#+END_SRC -** Selection & Minibuffer -*** Selectrum & Prescient -#+begin_src emacs-lisp - (use-package selectrum - :config - (selectrum-mode +1)) - - (use-package prescient - :config - (prescient-persist-mode +1)) - - (use-package selectrum-prescient - :after (selectrum prescient) - :config - (selectrum-prescient-mode +1)) -#+end_src -** Search -*** CtrlF for searching -#+BEGIN_SRC emacs-lisp - (use-package ctrlf - :custom - (ctrlf-show-match-count-at-eol nil) - :config - (ctrlf-mode +1) - :bind - ("C-s" . ctrlf-forward-regexp)) -#+END_SRC -*** [[https://github.com/benma/visual-regexp.el][Visual Regexp]] #+begin_src emacs-lisp - (use-package visual-regexp - :bind - ([remap query-replace] . 'vr/query-replace)) -#+end_src -** Undo -#+BEGIN_SRC emacs-lisp - (use-package undo-fu - :bind - ("C-/" . undo-fu-only-undo) - ("C-?" . undo-fu-only-redo)) - - (use-package undo-fu-session - :after no-littering + (use-package recentf + :custom-update + (recentf-exclude + (no-littering-var-directory + no-littering-etc-directory)) :custom - (undo-fu-session-incompatible-files - '("/COMMIT_EDITMSG\\'" - "/git-rebase-todo\\'")) - (undo-fu-session-directory - (no-littering-expand-var-file-name "undos/")) - :config - (global-undo-fu-session-mode +1)) -#+END_SRC -** Visual editing -*** ~zap-to-char~ replacement -#+BEGIN_SRC emacs-lisp - (use-package zop-to-char - :bind - ([remap zap-to-char] . zop-to-char) - ([remap zap-up-to-char] . zop-up-to-char)) -#+END_SRC -*** Operate on a line if there's no current region -#+BEGIN_SRC emacs-lisp - (use-package whole-line-or-region - :config - (whole-line-or-region-global-mode +1)) -#+END_SRC -*** Expand-region -#+BEGIN_SRC emacs-lisp - (use-package expand-region - :bind - ("C-=" . er/expand-region) - ("C-+" . er/contract-region)) -#+END_SRC -*** Volatile highlights -#+BEGIN_SRC emacs-lisp - (use-package volatile-highlights - :config - (volatile-highlights-mode 1)) -#+END_SRC -*** Visual line mode -#+BEGIN_SRC emacs-lisp - (global-visual-line-mode 1) -#+END_SRC -*** A better ~move-beginning-of-line~ -#+BEGIN_SRC emacs-lisp - (defun my/smarter-move-beginning-of-line (arg) - "Move point back to indentation of beginning of line. - - Move point to the first non-whitespace character on this line. - If point is already there, move to the beginning of the line. - Effectively toggle between the first non-whitespace character and - the beginning of the line. - - If ARG is not nil or 1, move forward ARG - 1 lines first. If - point reaches the beginning or end of the buffer, stop there." - (interactive "^p") - (setq arg (or arg 1)) - - ;; Move lines first - (when (/= arg 1) - (let ((line-move-visual nil)) - (forward-line (1- arg)))) - - (let ((orig-point (point))) - (back-to-indentation) - (when (= orig-point (point)) - (move-beginning-of-line 1)))) - - (bind-key "C-a" #'my/smarter-move-beginning-of-line) -#+END_SRC -** Delete the selection when typing -#+BEGIN_SRC emacs-lisp - (delete-selection-mode 1) -#+END_SRC -** Clipboard -#+BEGIN_SRC emacs-lisp - (cuss save-interprogram-paste-before-kill t) -#+END_SRC -** Tabs & Spaces -#+BEGIN_SRC emacs-lisp - (cuss sentence-end-double-space t) - - ;; cf https://dougie.io/emacs/indentation/ - ;; Create a variable for our preferred tab width - (setq custom-tab-width 4) - - ;; Two callable functions for enabling/disabling tabs in Emacs - (defun disable-tabs () (setq indent-tabs-mode nil)) - (defun enable-tabs () - (setq indent-tabs-mode t) - (setq tab-width custom-tab-width)) - - ;; Hooks to Enable Tabs - (add-hook 'prog-mode-hook 'enable-tabs) - ;; Hooks to Disable Tabs - (add-hook 'lisp-mode-hook 'disable-tabs) - (add-hook 'emacs-lisp-mode-hook 'disable-tabs) - - ;; Language-Specific Tweaks - (setq-default python-indent-offset custom-tab-width) ;; Python - (setq-default js-indent-level custom-tab-width) ;; Javascript - - ;; Make the backspace properly erase the tab instead of - ;; removing 1 space at a time. - (setq backward-delete-char-untabify-method 'hungry) - - ;; WARNING: This will change your life - ;; (OPTIONAL) Visualize tabs as a pipe character - "|" - ;; This will also show trailing characters as they are useful to spot. - (setq whitespace-style '(face tabs tab-mark trailing)) - (custom-set-faces - '(whitespace-tab ((t (:foreground "#636363"))))) - (setq whitespace-display-mappings - '((tab-mark 9 [124 9] [92 9]))) ; 124 is the ascii ID for '\|' - (global-whitespace-mode) ; Enable whitespace mode everywhere - - (use-package smart-tabs-mode - :init - (smart-tabs-insinuate 'c 'javascript)) -#+END_SRC -* Programming -** Git -#+BEGIN_SRC emacs-lisp - (use-package magit + (recentf-max-menu-items 100) + (recentf-max-saved-items 100) :bind - ("C-x g" . magit-status) - :config - (add-to-list 'magit-no-confirm 'stage-all-changes)) - - ;; hook into `prescient' - (define-advice magit-list-refs - (:around (orig &optional namespaces format sortby) - prescient-sort) - "Apply prescient sorting when listing refs." - (let ((res (funcall orig namespaces format sortby))) - (if (or sortby - magit-list-refs-sortby - (not selectrum-should-sort-p)) - res - (prescient-sort res)))) - - (when (executable-find "cmake") - (use-package libgit) - (use-package magit-libgit)) - - (use-package forge - :after magit - :custom - (forge-owned-accounts '(("duckwork")))) -#+END_SRC -** Code display -#+BEGIN_SRC emacs-lisp - (add-hook 'prog-mode-hook #'prettify-symbols-mode) -#+END_SRC -*** Parentheses -#+BEGIN_SRC emacs-lisp - (cuss show-paren-style 'mixed) - (show-paren-mode +1) - - (use-package smartparens - :init - (defun acdw/setup-smartparens () - (require 'smartparens-config) - (smartparens-mode +1)) - :hook - (prog-mode . acdw/setup-smartparens)) - - (use-package rainbow-delimiters - :hook - (prog-mode . rainbow-delimiters-mode)) -#+END_SRC -** Line numbers -#+BEGIN_SRC emacs-lisp - (add-hook 'prog-mode-hook - (if (and (fboundp 'display-line-numbers-mode) - (display-graphic-p)) - #'display-line-numbers-mode - #'linum-mode)) -#+END_SRC -** Languages -*** Shell -#+begin_src emacs-lisp - (use-package shfmt - :custom - (shfmt-arguments '("-i" "4" "-ci")) - :hook - (sh-mode . shfmt-on-save-mode)) - - ;; fish - (use-package fish-mode) -#+end_src -*** Lua -#+BEGIN_SRC emacs-lisp - (use-package lua-mode - :mode "\\.lua\\'" - :interpreter "lua") -#+END_SRC -*** Fennel -#+BEGIN_SRC emacs-lisp - (use-package fennel-mode - :mode "\\.fnl\\'") -#+END_SRC -*** Web -#+BEGIN_SRC emacs-lisp - (use-package web-mode - :custom - (web-mode-markup-indent-offset 2) - (web-mode-code-indent-offset 2) - (web-mode-css-indent-offset 2) - :mode (("\\.ts\\'" . web-mode) - ("\\.html?\\'" . web-mode) - ("\\.css?\\'" . web-mode) - ("\\.js\\'" . web-mode))) -#+END_SRC -*** SSH config -#+begin_src emacs-lisp - (use-package ssh-config-mode) -#+end_src -*** Lisp (SLIME) -#+begin_src emacs-lisp - (use-package slime - :when (executable-find "sbcl") - :custom - (inferior-lisp-program "sbcl") - (slime-contribs '(slime-fancy)) - ;;:config - ;;(load (expand-file-name "~/.quicklisp/slime-helper.el")) - ) -#+end_src -* Writing -** Word count -#+begin_src emacs-lisp - (use-package wc-mode - :config - (rm-whitelist-add "WC") - :hook - (text-mode . wc-mode)) -#+end_src -** Visual fill column -#+begin_src emacs-lisp - (use-package visual-fill-column - :custom - (split-window-preferred-function 'visual-fill-column-split-window-sensibly) - (visual-fill-column-center-text t) - (fill-column 80) - :config - (advice-add 'text-scale-adjust - :after #'visual-fill-column-adjust) - :hook - (org-mode . visual-fill-column-mode)) -#+end_src -** Org mode -#+begin_src emacs-lisp - (use-package org - :custom - (org-startup-indented t) - (org-src-tab-acts-natively t) - (org-hide-emphasis-markers t) - (org-fontify-done-headline t) - (org-hide-leading-stars t) - (org-pretty-entities t) - (org-src-window-setup 'current-window) - :hook - (org-mode . variable-pitch-mode)) - - (use-package org-superstar - :hook - (org-mode . org-superstar-mode)) -#+end_src -*** Org export to gemini -#+begin_src emacs-lisp - (use-package ox-gemini - :straight (ox-gemini - :repo "https://git.sr.ht/~abrahms/ox-gemini" - :branch "main")) -#+end_src -* Applications -** Gemini & Gopher -#+BEGIN_SRC emacs-lisp - (use-package elpher - :straight (elpher - :repo "git://thelambdalab.xyz/elpher.git") - :custom - (elpher-certificate-directory - (no-littering-expand-var-file-name "elpher-certificates/")) - (elpher-ipv4-always t) - :config - (defun elpher:eww-browse-url (original url &optional new-window) - "Handle gemini/gopher links with eww." - (cond ((string-match-p "\\`\\(gemini\\|gopher\\)://" url) - (require 'elpher) - (elpher-go url)) - (t (funcall original url new-window)))) - (advice-add 'eww-browse-url :around 'elpher:eww-browse-url) - :bind (:map elpher-mode-map - ("n" . elpher-next-link) - ("p" . elpher-prev-link) - ("o" . elpher-follow-current-link) - ("G" . elpher-go-current)) - :hook - (elpher-mode . visual-fill-column-mode)) - - (use-package gemini-mode - :straight (gemini-mode - :repo "https://git.carcosa.net/jmcbray/gemini.el.git") - :mode "\\.\\(gemini|gmi\\)\\'" - :hook - (gemini-mode . visual-fill-column-mode)) - - (use-package gemini-write - :straight (gemini-write - :repo "https://alexschroeder.ch/cgit/gemini-write")) - - (use-package post-to-gemlog-blue - :straight (post-to-gemlog-blue - :repo "https://git.sr.ht/~acdw/post-to-gemlog-blue.el")) -#+END_SRC -** Pastebin -#+BEGIN_SRC emacs-lisp - (use-package 0x0 - :custom - (0x0-default-service 'ttm)) -#+END_SRC -** Gnus -#+begin_src emacs-lisp - (cuss gnus-select-method - '(nnimap "imap.fastmail.com" - (nnimap-inbox "INBOX") - (nnimap-split-methods default) - (nnimap-expunge t) - (nnimap-stream ssl))) - - (cuss gnus-secondary-select-methods - '((nntp "news.gwene.org"))) -#+end_src -** Nov.el: read Ebooks -#+begin_src emacs-lisp - (use-package nov - :mode ("\\.epub\\'" . nov-mode) - :custom - (nov-text-width t) - :hook - (nov-mode . visual-line-mode) - (nov-mode . visual-fill-column-mode)) -#+end_src -** Circe: IRC -Commented for now while I figure out exactly what I want from IRC, et al. -#+begin_src emacs-lisp - ;; (cuss auth-sources '("~/.authinfo")) - - ;; (defun acdw/fetch-password (&rest params) - ;; (require 'auth-source) - ;; (let ((match (car (apply 'auth-source-search params)))) - ;; (if match - ;; (let ((secret (plist-get match :secret))) - ;; (if (functionp secret) - ;; (funcall secret) - ;; secret)) - ;; (error "Password not found for %S" params)))) - - ;; (defun acdw/nickserv-password (nick server) - ;; (acdw/fetch-password :login nick :machine server)) - - ;; (defun acdw/setup-lui () - ;; (interactive) - ;; (setq right-margin-width 5) - ;; (setq fringes-outside-margins t) - ;; (setq word-wrap t) - ;; (setq wrap-prefix " ") - ;; (setf (cdr (assoc 'continuation fringe-indicator-alist)) nil)) - - ;; (defun acdw/circe-prompt () - ;; (lui-set-prompt - ;; (concat (propertize (concat (buffer-name) ">") - ;; 'face 'circe-prompt-face) - ;; " "))) - - ;; (use-package circe - ;; :init - ;; (defun acdw/setup-circe () - ;; (whitespace-mode -1) - ;; (enable-lui-autopaste)) - ;; :custom - ;; (circe-default-part-message "Peace out, cub scouts") - ;; (circe-default-quit-message "See You Space Cowpokes....") - ;; (circe-default-realname "Case") - ;; (circe-highlight-nick-type 'all) - ;; (circe-reduce-lurker-spam t) - ;; (circe-format-say "{nick:-15s}| {body}") - ;; (circe-format-self-say "{nick:-15s}> {body}") - ;; (circe-format-action " * {nick} {body}") - ;; (circe-format-message " *{nick}* {body}") - ;; (circe-format-message-action " * *{nick}* {body}") - ;; (circe-format-self-action " * {nick} {body}") - ;; (circe-use-cycle-completion t) - ;; (circe-channel-killed-confirmation nil) - ;; (circe-color-nicks-everywhere t) - ;; (circe-default-nick "acdw") - ;; (circe-default-user "acdw") - ;; (circe-server-auto-join-default-type :after-auth) - ;; (lui-time-stamp-position 'right-margin) - ;; (lui-fill-type nil) - ;; (lui-time-stamp-format "%H:%M") - ;; (lui-track-bar-behavior 'before-switch-to-buffer) - ;; (circe-network-options - ;; `(("Freenode" - ;; :tls t - ;; :host "irc.acdw.net" - ;; :port 16789 - ;; :nick "acdw" - ;; :sasl-username "acdw" - ;; :sasl-password "freenode:purple-mountains-majesty" - ;; :channels ("#emacs")) - ;; ("Tilde.chat" - ;; :tls t - ;; :host "irc.acdw.net" - ;; :port 16789 - ;; :nick "acdw" - ;; :sasl-username "acdw" - ;; :sasl-password "tilde.chat:purple-mountains-majesty" - ;; :channels ("#gemini" "#meta" "#team" "#bread")))) - ;; :custom-face - ;; (circe-highlight-nick-face ((t (:inherit bold)))) - ;; (circe-originator-face ((t (:weight bold)))) - ;; (circe-prompt-face ((t (:foreground "blue")))) - ;; (lui-time-stamp-face ((t (:foreground "#808080" :height 0.8)))) - ;; :config - ;; (enable-lui-track-bar) - ;; (enable-circe-color-nicks) - ;; (enable-circe-display-images) - ;; :hook - ;; (circe-channel-mode . acdw/setup-circe) - ;; (circe-chat-mode . acdw/circe-prompt) - ;; (lui-mode . acdw/setup-lui)) -#+end_src -** Elfeed: Feed reader -Elfeed keeps freezing emacs. I'm commenting this for now. -#+begin_src emacs-lisp - ;; (use-package elfeed - ;; :custom - ;; (elfeed-feeds - ;; '(("https://acdw.net/atom.xml" me) - ;; ("https://planet.emacslife.com/atom.xml" emacs programming blog) - ;; ("https://www.xkcd.com/rss.xml" comics) - ;; ("https://portal.mozz.us/gemini/breadpunk.club/~bakersdozen/gemlog/atom.xml" friends) - ;; ("https://kotobank.ch/~vaartis/rss.xml" friends) - ;; ("https://m455.casa/feed.rss" friends) - ;; ("https://eli.li/feed.rss" friends) - ;; ("http://len.falken.ink/" friends) - ;; ("https://cadence.moe/blog/atom.xml?limit=30" friends) - ;; ("https://benjaminwil.info/feed.xml" friends) - ;; ("https://www.5snb.club/rss.xml" friends) - ;; ("https://write.lain.faith/@/haskal/atom.xml" friends) - ;; ("https://p1k3.com/feed" friends) - ;; ))) -#+end_src -* Machine-specific configurations -#+begin_src emacs-lisp - (use-package su - :when *acdw/at-home* + ("C-x C-r" . recentf-open-files) :config - (su-mode 1)) - - (use-package trashed - :when *acdw/at-home* - :custom - (delete-by-moving-to-trash t)) - - (use-package exec-path-from-shell - :when *acdw/at-home* - :demand - :config - (exec-path-from-shell-initialize)) + (recentf-mode 1)) #+end_src -- cgit 1.4.1-21-gabe81 From 7c6fa50ba4ae0803c27b6154daac89f71f30da07 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 21 Nov 2020 18:34:18 -0600 Subject: full on bankruptcy --- config.org | 345 +++++++++++++++++++++++++++---------------------------------- 1 file changed, 151 insertions(+), 194 deletions(-) diff --git a/config.org b/config.org index a1bd3e6..08a5418 100644 --- a/config.org +++ b/config.org @@ -1,136 +1,66 @@ -#+TITLE: Emacs config +#+TITLE: Emacs configuration, literate style #+AUTHOR: Case Duckworth -# -*- encoding: utf-8-unix -*- -#+BABEL: :cache yes #+PROPERTY: header-args :tangle init.el #+OPTIONS: toc:nil -#+BANKRUPTCY_COUNT: 1.5 - -* Preamble - -** Inspiration - -I've been inspired by [[https://github.com/larstvei/dot-emacs][Lars Tveito]]'s config, which does exactly what I -want: =init.el= is small and simple, and is replaced after the first -run by the tangled contents of this file -- =config.org= -- which is -furthermore automatically tangled. - -** Problems with this setup - -+ While =config.org= automatically tangles, I can't run =(load-file - init.el)= -- it results in an endless loop for some reason. I might - need to look into a hook of some kind. - -* License - -Copyright © 2020 Case Duckworth - -This work is free. You can redistribute it and/or modify it under the -terms of the Do What the Fuck You Want To Public License, Version 2, -as published by Sam Hocevar. See the LICENSE file, or below, for more -details. - -NOTE: the WTFPL is probably (most definitely!) not compatible with GNU -Emacs's license, and I'm not sure, though I'm pretty confident, that -my =config.org= would be classified as a /derivative work/ under those -terms. Therefore, me licensing my =config.org= under the WTFPL is at -best, unenforceable, and at worst, downright in violation of the GPL. - -SUE ME, RMS !!! - -#+begin_src text :tangle LICENSE - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - - Version 2, December 2004 - - Copyright (C) 2004 Sam Hocevar - - Everyone is permitted to copy and distribute verbatim or modified copies of - this license document, and changing it is allowed as long as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. - -#+end_src +#+BANKRUPTCY_COUNT: 2 * Bootstrap -When this configuration is loaded for the first time, /this/ =init.el= -is loaded: +** Original init.el #+begin_src emacs-lisp :tangle no - ;; This file replaces itself with the actual configuration when first - ;; run. To keep only this version tracked by git, run the command + ;; This file replaces itself with the actual configuration when + ;; first run. To keep only this version in git, run this command: ;; ;; git update-index --assume-unchanged init.el ;; - ;; If it needs to be changed, start tracking it again with the command + ;; If it needs to be changed, start tracking it again thusly: ;; ;; git update-index --no-assume-unchanged init.el - ;; - ;; edit as needed, and run the first command again. + (require 'org) (find-file (concat user-emacs-directory "config.org")) (org-babel-tangle) - (load-file (concat-user-emacs-directory "early-init.el")) - (load-file (concat-user-emacs-directory "init.el")) + (load-file (concat user-emacs-directory "early-init.el")) + (load-file (concat user-emacs-directory "init.el")) + (byte-compile-file (concat user-emacs-directory "init.el")) #+end_src ** Tangling -After first running Emacs with this config, the above snippet will be -replaced by the result of tangling this file. However, when we edit -=config.org=, we'll need to retangle it. The default keybinding to -tangle is =C-c C-v t=, which takes a while and is easy to forget. So -let's automatically tangle =config.org= on save. - -#+NAME: tangle-on-save #+begin_src emacs-lisp - ;;; init.el -*- lexical-binding: t; coding: utf-8-unix -*- + ;; init.el -*- lexical-binding: t -*- + (defun acdw/tangle-init () - "If the current buffer is `config.org', the code blocks are - tangled, and the tangled file is compiled and loaded." + "If the current buffer is `config.org', tangle it, then compile + and load the resulting files." + (when (equal (buffer-file-name) + (expand-file-name + (concat user-emacs-directory "config.org"))) + (let ((prog-mode-hook nil)) + (require 'org) + (org-babel-tangle-file + (expand-file-name + (concat user-emacs-directory "config.org")))))) + + (defun acdw/load-init () (interactive) - (let (config-org (expand-file-name - (concat user-emacs-directory "config.org"))) - (when (equal (buffer-file-name) config-org) - (require 'async) - (async-start - `(lambda () - ;; Avoid running hooks when tangling. - (let ((prog-mode-hook nil)) - (require 'org) - (org-babel-tangle-file config-org))) - (lambda (_) - (message "Tangle complete.")))))) - - ;; Add a hook to tangle config.org. - (add-hook 'after-save-hook #'acdw/tangle-init) + (load-file (expand-file-name + (concat user-emacs-directory "early-init.el"))) + (load-file (expand-file-name + (concat user-emacs-directory "init.el")))) #+end_src * Early initiation -Emacs 27.1+ uses =early-init.el= /in addition to/ =init.el=, mostly -for settings related to packags. Since I use =straight.el= for -package management, I need to specify that in this file. - #+begin_src emacs-lisp :tangle early-init.el - ;;; early-init.el -*- lexical-binding: t; no-byte-compile: t -*- - ;; DO NOT EDIT THIS FILE BY HAND. Edit =config.org= instead! + ;; early-init.el -*- lexical-binding: t; no-byte-compile: t -*- (setq load-prefer-newer t) - (when (eq system-type 'windows-nt) ; I'm at work + (when (eq system-type 'windows-nt) (add-to-list 'exec-path "~/bin") - (add-to-list 'exec-path - "C:/Users/aduckworth/Downloads/PortableGit/bin")) - - ;; This DOES NOT WORK on Windows. - ;; Download the repo directly from Github and unzip it into - ;; ~/.emacs.d/straight/repos/straight.el. + (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin")) (defvar bootstrap-version) (let ((bootstrap-file @@ -146,128 +76,155 @@ package management, I need to specify that in this file. (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) - ;; Use-package - (setq straight-use-package-by-default t) (straight-use-package 'use-package) - - ;; Use-package extra keywords - - (use-package use-package-custom-update - :straight (use-package-custom-update - :host github - :repo "a13/use-package-custom-update")) - #+end_src -* Macros +* Theme -** cuss +I want to try using the [[https://github.com/kunalb/poet][Poet]] theme. -I like =use-package= a lot, but I don't like the weird -"pseudo-package" things you see with a lot of =use-package= setups -around the Internet. They're cludgy, they /don't/ actually, in my -opinion anyway, make the config any easier to read (how am I supposed -to know what options are in =mule=, for example?!), and most -importantly, =straight.el= doesn't really like them that much. +#+begin_src emacs-lisp + (use-package poet-theme) +#+end_src -*However*, I really like the =:custom= keyword in =use-package=, - enough to implement it as my own macro. =cuss= will automagically - call =custom-set-variable= or =setq=, whichever is best for the - variable being tweaked. I pulled this straight from =use-package=, - so I /know/ it works! :P +I also want to switch themes between night and day. #+begin_src emacs-lisp - (defmacro cuss (var val) - "Basically the `:custom' macro from `use-package', by itself." - `(progn - (funcall (or (get ',var 'custom-set) #'set-default) - ',var ,val))) -;;; test + (use-package theme-changer + :custom + (calendar-latitude 30.39) + (calendar-longitude -91.83) + :config + (change-theme 'poet 'poet-dark)) #+end_src -* Machines +* Simplify GUI -I use Emacs on a couple of different computers: my two at home, and -assorted Windows machines at work. I define a couple of constants to -easily keep track of which computer I'm using. +#+begin_src emacs-lisp + (menu-bar-mode -1) + (tool-bar-mode -1) + (scroll-bar-mode -1) + + (global-visual-line-mode 1) +#+end_src + +* Fonts #+begin_src emacs-lisp - (defconst *acdw/at-work* (eq system-type 'windows-nt)) + (require 'cl) + (defun font-candidate (&rest fonts) + (loop for font in fonts + when (find-font (font-spec :name font)) + return font)) + + (set-face-attribute 'default nil + :font + (font-candidate + "Go Mono-11" + "Consolas-11")) + + (set-face-attribute 'fixed-pitch nil + :font + (font-candidate + "Go Mono-11" + "Consolas-11")) + + (set-face-attribute 'variable-pitch nil + :font + (font-candidate + "Go-12" + "Georgia-11")) +#+end_src - (defconst *acdw/at-larry* (string= (system-name) "larry")) - (defconst *acdw/at-bax* (string= (system-name) "bax")) - (defconst *acdw/at-home* (or *acdw/at-larry* *acdw/at-bax*)) +** Unicode + +#+begin_src emacs-lisp + (use-package unicode-fonts + :config + (unicode-fonts-setup)) #+end_src -* Files +** Variable pitch faces -** Keep .emacs.d tidy +#+begin_src emacs-lisp + (add-hook 'text-mode-hook + (lambda () + (variable-pitch-mode 1))) +#+end_ - By default, Emacs keeps files all over the damn place. I like the - =no-littering= package to keep files in one of two directories -- - =etc/= and =var/=. I'm going to require it right away so that I can - immediately use it. +* TODO Emacs configuration [meta] - #+begin_src emacs-lisp - (use-package no-littering) - (require 'no-littering) - #+end_src +** Keep =~/.emacs.d= tidy -** Customize +* TODO Ease of use -I don't use the customize interface -- but sometimes it's good to -figure out what settings are available for a package. So I keep the -customizations in a file (some people just throw it in =/dev/null=), -but I /don't/ load the file. +** Selectrum -#+begin_src emacs-lisp - (cuss custom-file (no-littering-expand-etc-file-name "custom.el")) -#+end_src +** Prescient -** Encoding +** CtrlF -It's 2020 -- let's use UTF-8 everywhere. Furthermore, even Notepad -can figure out Unix line endings (=LF=) -- so let's only use that. +** Startup -I'm going to be perfectly honest here. I'm not sure what like, any of -these do. I just threw everything =utf-8-unix= into a block and hope -for the best. +** Ignore case -#+begin_src emacs-lisp - (prefer-coding-system 'utf-8-unix) - (set-default-coding-systems 'utf-8-unix) - (set-terminal-coding-system 'utf-8-unix) - (set-keyboard-coding-system 'utf-8-unix) - (set-selection-coding-system 'utf-8-unix) - (set-file-name-coding-system 'utf-8-unix) - (set-clipboard-coding-system 'utf-8-unix) - (set-buffer-file-coding-system 'utf-8-unix) - (cuss locale-coding-system 'utf-8-unix) - (cuss x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) -#+end_src +* TODO Persistence + +** Auto-saves + +** Backup files ** Recent files -Though I haven't used this feature ... yet, maybe if I use the =C-x -C-r= binding that is suggested (like /everywhere/), it'll be easier -for me to use. +** Save places in visited files -I'm putting =recentf= in a =use-package= declaration, by the way, -because even though it's a part of Emacs, it's conveniently in its own -package. +** Save history -#+begin_src emacs-lisp - (use-package recentf - :custom-update - (recentf-exclude - (no-littering-var-directory - no-littering-etc-directory)) - :custom - (recentf-max-menu-items 100) - (recentf-max-saved-items 100) - :bind - ("C-x C-r" . recentf-open-files) - :config - (recentf-mode 1)) -#+end_src +** Undo + +* TODO General editing + +** Undo + +** Find/replace + +** Expand region + +* TODO Writing + +** Word count + +** Visual fill column mode + +** Org mode + +* TODO Coding + +** Display + +*** Prettify symbols mode + +*** Parentheses and frens + +*** Line numbers + +** Git + +** Programming languages + +*** Shell + +*** Lisp + +*** Fennel + +*** Lua + +*** Web (HTML/CSS/JS) + +* Applications + +** Elpher + +** Pastebin (0x0) -- cgit 1.4.1-21-gabe81 From dbd3abcbd507c53b625377566ceb166ebbac1b81 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 21 Nov 2020 23:24:59 -0600 Subject: Pulling myself ever-so-slowly out of the hole --- config.org | 479 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 447 insertions(+), 32 deletions(-) diff --git a/config.org b/config.org index 08a5418..01e5ac2 100644 --- a/config.org +++ b/config.org @@ -43,6 +43,8 @@ (expand-file-name (concat user-emacs-directory "config.org")))))) + (add-hook 'after-save-hook #'acdw/tangle-init) + (defun acdw/load-init () (interactive) (load-file (expand-file-name @@ -80,12 +82,55 @@ (straight-use-package 'use-package) #+end_src +* Macros + +** Customizing variables + +#+begin_src emacs-lisp + (defmacro cuss (var val) + "Basically `use-package''s `:custom', but without using either." + `(progn + (funcall (or (get ',var 'custom-set) #'set-default) + ',var ,val))) +#+end_src + * Theme -I want to try using the [[https://github.com/kunalb/poet][Poet]] theme. +I'm using the [[https://protesilaos.com/modus-themes/][Modus]] themes. #+begin_src emacs-lisp - (use-package poet-theme) + (defmacro modus-themes-format-sexp (sexp &rest objects) + `(eval (read (format ,(format "%S" sexp) ,@objects)))) + + (dolist (theme '("operandi" "vivendi")) + (modus-themes-format-sexp + (use-package modus-%1$s-theme + :init + (setq modus-%1$s-theme-slanted-constructs t + modus-%1$s-theme-bold-constructs t + modus-%1$s-theme-fringes 'subtle + modus-%1$s-theme-mode-line '3d + modus-%1$s-theme-syntax 'yellow-comments + modus-%1$s-theme-intense-hl-line nil + modus-%1$s-theme-intense-paren-match t + modus-%1$s-theme-links nil + modus-%1$s-theme-no-mixed-fonts nil + modus-%1$s-theme-prompts nil + modus-%1$s-theme-completions nil + modus-%1$s-theme-diffs nil + modus-%1$s-theme-org-blocks 'grayscale + modus-%1$s-theme-headings + '((1 . section) + (2 . line) + (t . rainbow-line-no-bold)) + modus-%1$s-theme-variable-pitch-headings nil + modus-%1$s-theme-scale-headings t + modus-%1$s-theme-scale-1 1.1 + modus-%1$s-theme-scale-2 1.15 + modus-%1$s-theme-scale-3 1.21 + modus-%1$s-theme-scale-4 1.27 + modus-%1$s-theme-scale-5 1.33)) + theme)) #+end_src I also want to switch themes between night and day. @@ -96,7 +141,7 @@ I also want to switch themes between night and day. (calendar-latitude 30.39) (calendar-longitude -91.83) :config - (change-theme 'poet 'poet-dark)) + (change-theme 'modus-operandi 'modus-vivendi)) #+end_src * Simplify GUI @@ -109,32 +154,57 @@ I also want to switch themes between night and day. (global-visual-line-mode 1) #+end_src +** Modeline + +#+begin_src emacs-lisp + (use-package smart-mode-line + :custom + (sml/no-confirm-load-theme t) + :config + (sml/setup)) + + (defun rm/whitelist-add (regexp) + "Add a REGEXP to the whitelist for `rich-minority'." + (if (listp 'rm--whitelist-regexps) + (add-to-list 'rm--whitelist-regexps regexp) + (setq rm--whitelist-regexps `(,regexp))) + (setq rm-whitelist + (mapconcat 'identity rm--whitelist-regexps "\\|"))) + + (use-package rich-minority + :config + (rm/whitelist-add "^$")) +#+end_src + * Fonts #+begin_src emacs-lisp (require 'cl) (defun font-candidate (&rest fonts) (loop for font in fonts - when (find-font (font-spec :name font)) - return font)) + when (find-font (font-spec :name font)) + return font)) (set-face-attribute 'default nil - :font - (font-candidate - "Go Mono-11" - "Consolas-11")) + :font + (font-candidate + "Linux Libertine Mono O-11" + "Go Mono-11" + "Consolas-11")) (set-face-attribute 'fixed-pitch nil - :font - (font-candidate - "Go Mono-11" - "Consolas-11")) + :font + (font-candidate + "Linux Libertine Mono O-11" + "Go Mono-11" + "Consolas-11")) (set-face-attribute 'variable-pitch nil - :font - (font-candidate - "Go-12" - "Georgia-11")) + :font + (font-candidate + "Linux Libertine O-12" + "Go-12" + "Georgia-11")) #+end_src ** Unicode @@ -148,83 +218,428 @@ I also want to switch themes between night and day. ** Variable pitch faces #+begin_src emacs-lisp - (add-hook 'text-mode-hook - (lambda () - (variable-pitch-mode 1))) -#+end_ + (add-hook 'text-mode-hook #'variable-pitch-mode) +#+end_src -* TODO Emacs configuration [meta] +* Emacs configuration [meta] ** Keep =~/.emacs.d= tidy +#+begin_src emacs-lisp + (straight-use-package 'no-littering) + (require 'no-littering) +#+end_src + +** Additional =use-package= keywords + +*** =:custom-update= + +#+begin_src emacs-lisp + (use-package use-package-custom-update + :straight (use-package-custom-update + :host github + :repo "a13/use-package-custom-update")) +#+end_src + * TODO Ease of use -** Selectrum +** Selectrum & Prescient + +#+begin_src emacs-lisp + (use-package selectrum + :config + (selectrum-mode 1)) -** Prescient + (use-package prescient + :config + (prescient-persist-mode 1)) + + (use-package selectrum-prescient + :after (selectrum prescient) + :config + (selectrum-prescient-mode 1)) +#+end_src ** CtrlF +#+begin_src emacs-lisp + (use-package ctrlf + :custom + (ctrlf-show-match-count-at-eol nil) + :config + (ctrlf-mode 1)) +#+end_src + ** Startup -** Ignore case +#+begin_src emacs-lisp + (cuss inhibit-startup-buffer-menu t) + (cuss inhibit-startup-screen t) + (cuss initial-buffer-choice t) + (cuss initial-scratch-message ";; Hi there!\n") +#+end_src -* TODO Persistence +** TODO Ignore case + +* Persistence ** Auto-saves +#+begin_src emacs-lisp + (use-package super-save + :custom + (auto-save-default nil) + (super-save-exclue '(".gpg")) + :config + (super-save-mode 1)) +#+end_src + ** Backup files +#+begin_src emacs-lisp + (cuss backup-directory-alist + `((".*" . ,(no-littering-expand-var-file-name "backup/")))) +#+end_src + ** Recent files +#+begin_src emacs-lisp + (use-package recentf + :custom-update + (recentf-exclude + '(no-littering-var-directory + no-littering-etc-directory)) + :custom + (recentf-max-menu-items 100) + (recentf-max-saved-items 100) + :config + (recentf-mode 1)) +#+end_src + ** Save places in visited files +#+begin_src emacs-lisp + (use-package saveplace + :custom + (save-place-file (no-littering-expand-var-file-name "places")) + (save-place-forget-unreadable-files (not + (eq system-type 'windows-nt)) + :config + (save-place-mode 1))) +#+end_src + ** Save history +#+begin_src emacs-lisp + (use-package savehist + :custom + (savehist-additional-variables + '(kill-ring + search-ring + regexp-search-ring)) + (savehist-save-minibuffer-history t) + :config + (savehist-mode 1)) +#+end_src + ** Undo -* TODO General editing +#+begin_src emacs-lisp + (use-package undo-fu-session + :after (no-littering undo-fu) + :custom + (undo-fu-session-incompatible-files + '("COMMIT_EDITMSG\\'" + "/git-rebase-todo\\'")) + (undo-fu-session-directory + (no-littering-expand-var-file-name "undos/")) + :config + (global-undo-fu-session-mode 1)) +#+end_src + +* General editing ** Undo +#+begin_src emacs-lisp + (use-package undo-fu + :bind + ("C-/" . undo-fu-only-undo) + ("C-?" . undo-fu-only-redo)) +#+end_src + ** Find/replace -** Expand region +#+begin_src emacs-lisp + (use-package visual-regexp + :bind + ("C-c r" . 'vr/replace) + ("C-c q" . 'vr/query-replace)) +#+end_src + +** Visual editing + +*** Volatile highlights + +#+begin_src emacs-lisp + (use-package volatile-highlights + :config + (volatile-highlights-mode 1)) +#+end_src + +*** Expand region -* TODO Writing + #+begin_src emacs-lisp + (use-package expand-region + :bind + ("C-=" . er/expand-region) + ("C-+" . er/contract-region)) + #+end_src + +* Writing ** Word count +#+begin_src emacs-lisp + (use-package wc-mode + :config + (rm/whitelist-add "WC") + :hook text-mode) +#+end_src + ** Visual fill column mode +#+begin_src emacs-lisp + (use-package visual-fill-column + :custom + (split-window-preferred-function + 'visual-fill-column-split-window-sensibly) + (visual-fill-column-center-text t) + (fill-column 80) + :config + (advice-add 'text-scale-adjust + :after #'visual-fill-column-adjust) + :hook + (text-mode . visual-fill-column-mode)) +#+end_src + ** Org mode +#+begin_src emacs-lisp + (use-package org + :custom + (org-startup-indented t) + (org-src-tab-acts-natively t) + (org-hide-emphasis-markers t) + (org-fontify-done-headline t) + (org-hide-leading-stars t) + (org-pretty-entities t)) +#+end_src + * TODO Coding +** Indenting + +#+begin_src emacs-lisp + (use-package aggressive-indent + :config + (global-aggressive-indent-mode 1)) +#+end_src + ** Display *** Prettify symbols mode +#+begin_src emacs-lisp + (add-hook 'prog-mode-hook #'prettify-symbols-mode) +#+end_src + *** Parentheses and frens +**** =show-paren-style= + +#+begin_src emacs-lisp + (cuss show-paren-style 'mixed) + (show-paren-mode 1) +#+end_src + +**** Smartparens + +#+begin_src emacs-lisp + (use-package smartparens + :init + (defun acdw/setup-smartparens () + (require 'smartparens-config) + (smartparens-mode 1)) + :hook + (prog-mode . acdw/setup-smartparens)) +#+end_src + +**** Rainbow delimiters + +#+begin_src emacs-lisp + (use-package rainbow-delimiters + :hook (prog-mode . rainbow-delimiters-mode)) +#+end_src + *** Line numbers +#+begin_src emacs-lisp + (defun acdw/enable-line-numbers () + "Enable line numbers, either through `display-line-numbers-mode' + or through `linum-mode'." + (if (and (fboundp 'display-line-numbers-mode) + (display-graphic-p)) + (display-line-numbers-mode 1) + (linum-mode 1))) + + (add-hook 'prog-mode-hook #'acdw/enable-line-numbers) +#+end_src + ** Git +#+begin_src emacs-lisp + (use-package magit + :bind + ("C-x g" . magit-status) + :custom-update + (magit-no-confirm '(stage-all-changes))) +#+end_src + +*** Hook into =prescient= + +#+begin_src emacs-lisp + (define-advice magit-list-refs + (:around (orig &optional namespaces format sortby) + prescient-sort) + "Apply prescient sorting when listing refs." + (let ((res (funcall orig namespaces format sortby))) + (if (or sortby + magit-list-refs-sortby + (not selectrum-should-sort-p)) + res + (prescient-sort res)))) +#+end_src + +*** Use =libgit= when I can build it (requires =cmake=) + +#+begin_src emacs-lisp + (when (executable-find "cmake") + (use-package libgit) + (use-package magit-libgit)) +#+end_src + +*** Git "forge" capabilities + +#+begin_src emacs-lisp + (use-package forge + :after magit + :custom + (forge-owned-accounts + '(("duckwork")))) +#+end_src + ** Programming languages -*** Shell +*** Fish shell + +#+begin_src emacs-lisp + (use-package fish-mode) +#+end_src + +*** Lisps -*** Lisp +**** SLIME -*** Fennel + #+begin_src emacs-lisp + (use-package slime + :when (executable-find "sbcl") + :custom + (inferior-lisp-program "sbcl") + (slime-contribs '(slime-fancy))) + #+end_src + +**** Fennel + +#+begin_src emacs-lisp + (use-package fennel-mode + :mode "\\.fnl\\'") +#+end_src *** Lua +#+begin_src emacs-lisp + (use-package lua-mode + :mode "\\.lua\\'" + :interpreter "lua") +#+end_src + *** Web (HTML/CSS/JS) +#+begin_src emacs-lisp + (use-package web-mode + :mode (("\\.ts\\'" . web-mode) + ("\\.html?\\'" . web-mode) + ("\\.css?\\'" . web-mode) + ("\\.js\\'" . web-mode))) +#+end_src + +*** =~/.ssh/config= + +#+begin_src emacs-lisp + (use-package ssh-config-mode) +#+end_src + * Applications ** Elpher +#+BEGIN_SRC emacs-lisp + (use-package elpher + :straight (elpher + :repo "git://thelambdalab.xyz/elpher.git") + :custom + (elpher-certificate-directory + (no-littering-expand-var-file-name "elpher-certificates/")) + (elpher-ipv4-always t) + :config + (defun elpher:eww-browse-url (original url &optional new-window) + "Handle gemini/gopher links with eww." + (cond ((string-match-p "\\`\\(gemini\\|gopher\\)://" url) + (require 'elpher) + (elpher-go url)) + (t (funcall original url new-window)))) + (advice-add 'eww-browse-url :around 'elpher:eww-browse-url) + :bind (:map elpher-mode-map + ("n" . elpher-next-link) + ("p" . elpher-prev-link) + ("o" . elpher-follow-current-link) + ("G" . elpher-go-current)) + :hook + (elpher-mode . visual-fill-column-mode)) + + (use-package gemini-mode + :straight (gemini-mode + :repo "https://git.carcosa.net/jmcbray/gemini.el.git") + :mode "\\.\\(gemini|gmi\\)\\'" + :hook + (gemini-mode . visual-fill-column-mode)) + + (use-package gemini-write + :straight (gemini-write + :repo "https://alexschroeder.ch/cgit/gemini-write") + :config + (add-to-list 'elpher-gemini-tokens '("gem.acdw.net" . "yellow-people-eater"))) + + (use-package post-to-gemlog-blue + :straight (post-to-gemlog-blue + :repo "https://git.sr.ht/~acdw/post-to-gemlog-blue.el")) +#+END_SRC + ** Pastebin (0x0) + +#+BEGIN_SRC emacs-lisp + (use-package 0x0 + :custom + (0x0-default-service 'ttm)) +#+END_SRC -- cgit 1.4.1-21-gabe81 From 4d3623d771a847bfa4e75ef339f4868cbb594c2c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 22 Nov 2020 00:00:15 -0600 Subject: Add async and stuff --- config.org | 146 ++++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 105 insertions(+), 41 deletions(-) diff --git a/config.org b/config.org index 01e5ac2..38f3d66 100644 --- a/config.org +++ b/config.org @@ -35,22 +35,28 @@ "If the current buffer is `config.org', tangle it, then compile and load the resulting files." (when (equal (buffer-file-name) - (expand-file-name - (concat user-emacs-directory "config.org"))) - (let ((prog-mode-hook nil)) - (require 'org) - (org-babel-tangle-file - (expand-file-name - (concat user-emacs-directory "config.org")))))) + (expand-file-name + (concat user-emacs-directory "config.org"))) + (require 'async) + (async-start + (lambda () + (let ((prog-mode-hook nil)) + (require 'org) + (org-babel-tangle-file + (expand-file-name + (concat user-emacs-directory "config.org"))))) + (lambda (response) + (acdw/load-init) + (message "Tangled and loaded: %s" response))))) (add-hook 'after-save-hook #'acdw/tangle-init) (defun acdw/load-init () (interactive) (load-file (expand-file-name - (concat user-emacs-directory "early-init.el"))) + (concat user-emacs-directory "early-init.el"))) (load-file (expand-file-name - (concat user-emacs-directory "init.el")))) + (concat user-emacs-directory "init.el")))) #+end_src * Early initiation @@ -60,28 +66,66 @@ (setq load-prefer-newer t) +#+end_src + +** Add PortableGit to the =exec-path= on Windows + +#+begin_src emacs-lisp :tangle early-init.el (when (eq system-type 'windows-nt) (add-to-list 'exec-path "~/bin") (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin")) +#+end_src +** Bootstrap =straight.el= + +#+begin_src emacs-lisp :tangle early-init.el (defvar bootstrap-version) (let ((bootstrap-file - (expand-file-name "straight/repos/straight.el/bootstrap.el" - user-emacs-directory)) - (bootstrap-version 5)) + (expand-file-name "straight/repos/straight.el/bootstrap.el" + user-emacs-directory)) + (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer - (url-retrieve-synchronously - "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" - 'silent 'inhibit-cookies) - (goto-char (point-max)) - (eval-print-last-sexp))) + (url-retrieve-synchronously + "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) +#+end_src + +** Use =use-package= +#+begin_src emacs-lisp :tangle early-init.el (setq straight-use-package-by-default t) (straight-use-package 'use-package) #+end_src +** Keep =~/.emacs.d= tidy + +#+begin_src emacs-lisp + (straight-use-package 'no-littering) + (require 'no-littering) +#+end_src + +** Additional =use-package= keywords + +*** =:custom-update= + +#+begin_src emacs-lisp + (use-package use-package-custom-update + :straight (use-package-custom-update + :host github + :repo "a13/use-package-custom-update")) +#+end_src + +** Setup async + +#+begin_src emacs-lisp :tangle early-init.el + (straight-use-package 'async) + (require 'async) +#+end_src + * Macros ** Customizing variables @@ -176,6 +220,14 @@ I also want to switch themes between night and day. (rm/whitelist-add "^$")) #+end_src +** Show =^L= as a line + +#+begin_src emacs-lisp + (use-package form-feed + :hook + ((text-mode prog-mode) . form-feed-mode)) +#+end_src + * Fonts #+begin_src emacs-lisp @@ -221,27 +273,7 @@ I also want to switch themes between night and day. (add-hook 'text-mode-hook #'variable-pitch-mode) #+end_src -* Emacs configuration [meta] - -** Keep =~/.emacs.d= tidy - -#+begin_src emacs-lisp - (straight-use-package 'no-littering) - (require 'no-littering) -#+end_src - -** Additional =use-package= keywords - -*** =:custom-update= - -#+begin_src emacs-lisp - (use-package use-package-custom-update - :straight (use-package-custom-update - :host github - :repo "a13/use-package-custom-update")) -#+end_src - -* TODO Ease of use +* Ease of use ** Selectrum & Prescient @@ -279,7 +311,23 @@ I also want to switch themes between night and day. (cuss initial-scratch-message ";; Hi there!\n") #+end_src -** TODO Ignore case +** Ignore case + +#+BEGIN_SRC emacs-lisp + (cuss completion-ignore-case t) + (cuss read-buffer-completion-ignore-case t) + (cuss read-file-name-completion-ignore-case t) +#+END_SRC + +** Which key + +#+begin_src emacs-lisp + (use-package which-key + :custom + (which-key-popup-type 'minibuffer) + :config + (which-key-mode)) +#+end_src * Persistence @@ -316,6 +364,19 @@ I also want to switch themes between night and day. (recentf-mode 1)) #+end_src +*** Easily navigate recent files + +#+begin_src emacs-lisp + (defun recentf-find-file () + "Find a recent file using `completing-read'." + (interactive) + (let ((file (completing-read "Recent file: " recentf-list nil t))) + (when file + (find-file file)))) + + (bind-key "C-x C-r" #'recentf-find-file) +#+end_src + ** Save places in visited files #+begin_src emacs-lisp @@ -432,11 +493,14 @@ I also want to switch themes between night and day. (org-src-tab-acts-natively t) (org-hide-emphasis-markers t) (org-fontify-done-headline t) + (org-fontify-whole-heading-line t) (org-hide-leading-stars t) - (org-pretty-entities t)) + (org-hidden-keywords '(author date title)) + (org-src-window-setup 'current-window) + (org-pretty-entities t)) #+end_src -* TODO Coding +* Coding ** Indenting -- cgit 1.4.1-21-gabe81 From 5d7a56e7cc5331bbaa7e0fd901300d1028997a08 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 23 Nov 2020 13:40:26 -0600 Subject: Add License --- config.org | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/config.org b/config.org index 38f3d66..7429b32 100644 --- a/config.org +++ b/config.org @@ -4,6 +4,35 @@ #+OPTIONS: toc:nil #+BANKRUPTCY_COUNT: 2 +* License + +Copyright © 2020 Case Duckworth + +This work is free. You can redistribute it and/or modify it under the terms of the Do What the Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the =LICENSE= file, tangled from the following source block, for details. + +#+begin_src text :tangle LICENSE + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified copies of + this license document, and changing it is allowed as long as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. +#+end_src + +** Note on the license + +It's highly likely that the WTFPL is completely incompatible with the GPL, for what should be fairly obvious reasons. To that, I say: + +*SUE ME, RMS!* + * Bootstrap ** Original init.el -- cgit 1.4.1-21-gabe81 From e44cbd8184ba2b03aa40bdb4249387f43f88593b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 23 Nov 2020 13:40:40 -0600 Subject: Add more paths to exec-path on Windows --- config.org | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config.org b/config.org index 7429b32..affa0b5 100644 --- a/config.org +++ b/config.org @@ -97,12 +97,14 @@ It's highly likely that the WTFPL is completely incompatible with the GPL, for w #+end_src -** Add PortableGit to the =exec-path= on Windows +** Add more paths to the =exec-path= when using Windows #+begin_src emacs-lisp :tangle early-init.el (when (eq system-type 'windows-nt) - (add-to-list 'exec-path "~/bin") - (add-to-list 'exec-path "C:/Users/aduckworth/Downloads/PortableGit/bin")) + (dolist (path '("~/bin" + "C:/Users/aduckworth/Downloads/PortableGit/bin" + "C:/Users/aduckworth/Downloads/PortableGit/usr/bin")) + (add-to-list 'exec-path path))) #+end_src ** Bootstrap =straight.el= -- cgit 1.4.1-21-gabe81 From 55c6bdcfd15e250fe1bc77b77dc11ade6ca07e4e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 23 Nov 2020 13:40:59 -0600 Subject: Change theme options --- config.org | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/config.org b/config.org index affa0b5..ac86e80 100644 --- a/config.org +++ b/config.org @@ -219,6 +219,15 @@ I also want to switch themes between night and day. (change-theme 'modus-operandi 'modus-vivendi)) #+end_src +By default, Emacs loads themes on top of each other. I don't want that, so let's apply this advice. + +#+begin_src emacs-lisp + (defadvice load-theme + (before disable-before-load + (theme &optional no-confirm no-enable) activate) + (mapc 'disable-theme custom-enabled-themes)) +#+end_src + * Simplify GUI #+begin_src emacs-lisp @@ -259,6 +268,13 @@ I also want to switch themes between night and day. ((text-mode prog-mode) . form-feed-mode)) #+end_src +** Cursor + +#+begin_src emacs-lisp + (cuss cursor-type 'bar) + (cuss cursor-in-non-selected-windows 'hollow) +#+end_src + * Fonts #+begin_src emacs-lisp @@ -271,6 +287,7 @@ I also want to switch themes between night and day. (set-face-attribute 'default nil :font (font-candidate + "Libertinus Mono-11" "Linux Libertine Mono O-11" "Go Mono-11" "Consolas-11")) @@ -278,6 +295,7 @@ I also want to switch themes between night and day. (set-face-attribute 'fixed-pitch nil :font (font-candidate + "Libertinus Mono-11" "Linux Libertine Mono O-11" "Go Mono-11" "Consolas-11")) @@ -285,6 +303,7 @@ I also want to switch themes between night and day. (set-face-attribute 'variable-pitch nil :font (font-candidate + "Libertinus Serif-12" "Linux Libertine O-12" "Go-12" "Georgia-11")) -- cgit 1.4.1-21-gabe81 From 3e91af85e666d45f6206103517639a0341611902 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 23 Nov 2020 13:41:11 -0600 Subject: Set miscellaneous settings --- config.org | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/config.org b/config.org index ac86e80..14ef1cd 100644 --- a/config.org +++ b/config.org @@ -379,6 +379,47 @@ By default, Emacs loads themes on top of each other. I don't want that, so let' (which-key-mode)) #+end_src +** Miscellaneous settings + +*** Set view mode when in a read-only file + +#+begin_src emacs-lisp + (cuss view-read-only t) +#+end_src + +*** Don't use dialog boxen + +#+begin_src emacs-lisp + (cuss use-dialog-box nil) +#+end_src + +*** Enable all functions + +#+begin_src emacs-lisp + (cuss disabled-command-function nil) +#+end_src + +*** Shorter confirmations + +#+begin_src emacs-lisp + (fset 'yes-or-no-p #'y-or-n-p) +#+end_src + +*** Uniquify buffer names + +#+begin_src emacs-lisp + (cuss uniquify-buffer-name-style 'forward) +#+end_src + +*** Show buffer boundaries + +#+begin_src emacs-lisp + (cuss indicate-buffer-boundaries + '((top . right) + (bottom . right) + (t . nil))) +#+end_src + * Persistence ** Auto-saves -- cgit 1.4.1-21-gabe81 From 3d195120e9cf01b4544d02176711b56ecd48f8eb Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 23 Nov 2020 13:41:23 -0600 Subject: Set default file encodings This requires more research. --- config.org | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config.org b/config.org index 14ef1cd..0d8324d 100644 --- a/config.org +++ b/config.org @@ -511,6 +511,22 @@ By default, Emacs loads themes on top of each other. I don't want that, so let' * General editing +** File encoding + +I'm going to be honest -- most of this is a stab in the dark. + +#+begin_src emacs-lisp + (prefer-coding-system 'utf-8-unix) + (set-default-coding-systems 'utf-8-unix) + (set-terminal-coding-system 'utf-8-unix) + (set-keyboard-coding-system 'utf-8-unix) + (set-selection-coding-system 'utf-8-unix) + (set-file-name-coding-system 'utf-8-unix) + (set-clipboard-coding-system 'utf-8-unix) + (set-buffer-file-coding-system 'utf-8-unix) + (cuss locale-coding-system 'utf-8-unix) + (cuss x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) +#+end_src ** Undo #+begin_src emacs-lisp -- cgit 1.4.1-21-gabe81 From f0ea71d7adfec0d5e4a9418fcd8f188a6005d191 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:31:11 -0600 Subject: Add About me section --- config.org | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index 0d8324d..624f3be 100644 --- a/config.org +++ b/config.org @@ -4,6 +4,14 @@ #+OPTIONS: toc:nil #+BANKRUPTCY_COUNT: 2 +* About me + +#+begin_src emacs-lisp + ;; init.el -*- lexical-binding: t -*- + (setq user-full-name "Case Duckworth" + user-mail-address "acdw@acdw.net") +#+end_src + * License Copyright © 2020 Case Duckworth @@ -58,8 +66,6 @@ It's highly likely that the WTFPL is completely incompatible with the GPL, for w ** Tangling #+begin_src emacs-lisp - ;; init.el -*- lexical-binding: t -*- - (defun acdw/tangle-init () "If the current buffer is `config.org', tangle it, then compile and load the resulting files." -- cgit 1.4.1-21-gabe81 From d0a6d2b0dc9dddf18b2e24edae817be464b72e37 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:31:31 -0600 Subject: Increase garbage collector early in init --- config.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config.org b/config.org index 624f3be..9a8e8fb 100644 --- a/config.org +++ b/config.org @@ -103,6 +103,18 @@ It's highly likely that the WTFPL is completely incompatible with the GPL, for w #+end_src +** Increase the garbage collector + +#+begin_src emacs-lisp :tangle early-init.el + (setq gc-cons-threshold (* 100 100 1000)) + + (add-hook 'after-init-hook + (lambda () + (setq gc-cons-threshold (* 100 100 100)) + (message "gc-cons-threshold restored to %S" + gc-cons-threshold))) +#+end_src + ** Add more paths to the =exec-path= when using Windows #+begin_src emacs-lisp :tangle early-init.el -- cgit 1.4.1-21-gabe81 From e3222f85095cca7956afa9192573f12005628180 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:31:59 -0600 Subject: Whitespace? I'm guessing --- config.org | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/config.org b/config.org index 9a8e8fb..990fe85 100644 --- a/config.org +++ b/config.org @@ -164,8 +164,8 @@ It's highly likely that the WTFPL is completely incompatible with the GPL, for w #+begin_src emacs-lisp (use-package use-package-custom-update :straight (use-package-custom-update - :host github - :repo "a13/use-package-custom-update")) + :host github + :repo "a13/use-package-custom-update")) #+end_src ** Setup async @@ -184,7 +184,7 @@ It's highly likely that the WTFPL is completely incompatible with the GPL, for w "Basically `use-package''s `:custom', but without using either." `(progn (funcall (or (get ',var 'custom-set) #'set-default) - ',var ,val))) + ',var ,val))) #+end_src * Theme @@ -200,29 +200,29 @@ I'm using the [[https://protesilaos.com/modus-themes/][Modus]] themes. (use-package modus-%1$s-theme :init (setq modus-%1$s-theme-slanted-constructs t - modus-%1$s-theme-bold-constructs t - modus-%1$s-theme-fringes 'subtle - modus-%1$s-theme-mode-line '3d - modus-%1$s-theme-syntax 'yellow-comments - modus-%1$s-theme-intense-hl-line nil - modus-%1$s-theme-intense-paren-match t - modus-%1$s-theme-links nil - modus-%1$s-theme-no-mixed-fonts nil - modus-%1$s-theme-prompts nil - modus-%1$s-theme-completions nil - modus-%1$s-theme-diffs nil - modus-%1$s-theme-org-blocks 'grayscale - modus-%1$s-theme-headings - '((1 . section) - (2 . line) - (t . rainbow-line-no-bold)) - modus-%1$s-theme-variable-pitch-headings nil - modus-%1$s-theme-scale-headings t - modus-%1$s-theme-scale-1 1.1 - modus-%1$s-theme-scale-2 1.15 - modus-%1$s-theme-scale-3 1.21 - modus-%1$s-theme-scale-4 1.27 - modus-%1$s-theme-scale-5 1.33)) + modus-%1$s-theme-bold-constructs t + modus-%1$s-theme-fringes 'subtle + modus-%1$s-theme-mode-line '3d + modus-%1$s-theme-syntax 'yellow-comments + modus-%1$s-theme-intense-hl-line nil + modus-%1$s-theme-intense-paren-match t + modus-%1$s-theme-links nil + modus-%1$s-theme-no-mixed-fonts nil + modus-%1$s-theme-prompts nil + modus-%1$s-theme-completions nil + modus-%1$s-theme-diffs nil + modus-%1$s-theme-org-blocks 'grayscale + modus-%1$s-theme-headings + '((1 . section) + (2 . line) + (t . rainbow-line-no-bold)) + modus-%1$s-theme-variable-pitch-headings nil + modus-%1$s-theme-scale-headings t + modus-%1$s-theme-scale-1 1.1 + modus-%1$s-theme-scale-2 1.15 + modus-%1$s-theme-scale-3 1.21 + modus-%1$s-theme-scale-4 1.27 + modus-%1$s-theme-scale-5 1.33)) theme)) #+end_src -- cgit 1.4.1-21-gabe81 From 987aea24ef70cd99fb393dc493a8da7790989525 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:32:07 -0600 Subject: Remove advice on theme loading --- config.org | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/config.org b/config.org index 990fe85..fecfb96 100644 --- a/config.org +++ b/config.org @@ -237,22 +237,20 @@ I also want to switch themes between night and day. (change-theme 'modus-operandi 'modus-vivendi)) #+end_src -By default, Emacs loads themes on top of each other. I don't want that, so let's apply this advice. - -#+begin_src emacs-lisp - (defadvice load-theme - (before disable-before-load - (theme &optional no-confirm no-enable) activate) - (mapc 'disable-theme custom-enabled-themes)) -#+end_src - * Simplify GUI +** Remove unneeded GUI elements + #+begin_src emacs-lisp (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) + (horizontal-scroll-bar-mode -1) +#+end_src +** Word wrap and operate visually + +#+begin_src emacs-lisp (global-visual-line-mode 1) #+end_src -- cgit 1.4.1-21-gabe81 From 93b06f2a69b7b00f742467c07caf811a1cbbabb7 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:32:23 -0600 Subject: Whitespace ... bleh --- config.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index fecfb96..e8e9037 100644 --- a/config.org +++ b/config.org @@ -266,10 +266,10 @@ I also want to switch themes between night and day. (defun rm/whitelist-add (regexp) "Add a REGEXP to the whitelist for `rich-minority'." (if (listp 'rm--whitelist-regexps) - (add-to-list 'rm--whitelist-regexps regexp) + (add-to-list 'rm--whitelist-regexps regexp) (setq rm--whitelist-regexps `(,regexp))) (setq rm-whitelist - (mapconcat 'identity rm--whitelist-regexps "\\|"))) + (mapconcat 'identity rm--whitelist-regexps "\\|"))) (use-package rich-minority :config -- cgit 1.4.1-21-gabe81 From e7447647deb8761e75c12591ccf62ccd9538a57a Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:32:37 -0600 Subject: Set fonts in a hook --- config.org | 56 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/config.org b/config.org index e8e9037..6c7ad20 100644 --- a/config.org +++ b/config.org @@ -293,6 +293,8 @@ I also want to switch themes between night and day. * Fonts +See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if-launching-emacs-in-daemon-mode][this StackExchange question and answer]] for more information on why I have these font settings applied in a hook. + #+begin_src emacs-lisp (require 'cl) (defun font-candidate (&rest fonts) @@ -300,29 +302,37 @@ I also want to switch themes between night and day. when (find-font (font-spec :name font)) return font)) - (set-face-attribute 'default nil - :font - (font-candidate - "Libertinus Mono-11" - "Linux Libertine Mono O-11" - "Go Mono-11" - "Consolas-11")) - - (set-face-attribute 'fixed-pitch nil - :font - (font-candidate - "Libertinus Mono-11" - "Linux Libertine Mono O-11" - "Go Mono-11" - "Consolas-11")) - - (set-face-attribute 'variable-pitch nil - :font - (font-candidate - "Libertinus Serif-12" - "Linux Libertine O-12" - "Go-12" - "Georgia-11")) + (defun acdw/setup-fonts () + "Setup fonts. This has to happen after the frame is set up for + the first time, so add it to `focus-in-hook'. It removes + itself." + (set-face-attribute 'default nil + :font + (font-candidate + "Libertinus Mono-11" + "Linux Libertine Mono O-11" + "Go Mono-11" + "Consolas-11")) + + (set-face-attribute 'fixed-pitch nil + :font + (font-candidate + "Libertinus Mono-11" + "Linux Libertine Mono O-11" + "Go Mono-11" + "Consolas-11")) + + (set-face-attribute 'variable-pitch nil + :font + (font-candidate + "Libertinus Serif-14" + "Linux Libertine O-12" + "Go-12" + "Georgia-11")) + + (remove-hook 'focus-in-hook #'acdw/setup-fonts)) + + (add-hook 'focus-in-hook #'acdw/setup-fonts) #+end_src ** Unicode -- cgit 1.4.1-21-gabe81 From 8dd120770ddda837e29b77d1d696289ca44dad78 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:32:49 -0600 Subject: Change search bindings to use regexp by default --- config.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config.org b/config.org index 6c7ad20..1947a85 100644 --- a/config.org +++ b/config.org @@ -374,6 +374,11 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if- (use-package ctrlf :custom (ctrlf-show-match-count-at-eol nil) + :bind + ("C-s" . ctrlf-forward-regexp) + ("C-r" . ctrlf-backward-regexp) + ("C-M-s" . ctrlf-forward-literal) + ("C-M-r" . ctrlf-backward-literal) :config (ctrlf-mode 1)) #+end_src -- cgit 1.4.1-21-gabe81 From 77985fcf60f660b8437c31226df019a24eacd6e7 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:33:02 -0600 Subject: Require uniquify --- config.org | 1 + 1 file changed, 1 insertion(+) diff --git a/config.org b/config.org index 1947a85..538220f 100644 --- a/config.org +++ b/config.org @@ -439,6 +439,7 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if- *** Uniquify buffer names #+begin_src emacs-lisp + (require 'uniquify) (cuss uniquify-buffer-name-style 'forward) #+end_src -- cgit 1.4.1-21-gabe81 From 9b1ce477453e778737ef67c23b34a0b30fd476d6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:33:25 -0600 Subject: Various better-defaults-style changes --- config.org | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 72 insertions(+), 13 deletions(-) diff --git a/config.org b/config.org index 538220f..c90e586 100644 --- a/config.org +++ b/config.org @@ -452,6 +452,38 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if- (t . nil))) #+end_src +*** Hippie expand + +#+begin_src emacs-lisp + (global-set-key (kbd "M-/") 'hippie-expand) +#+end_src + +*** iBuffer + +#+begin_src emacs-lisp + (global-set-key (kbd "C-x C-b") 'ibuffer) +#+end_src + +*** Zap-up-to-char, not zap-to-char + +#+begin_src emacs-lisp + (autoload 'zap-up-to-char "misc" + "Kill up to, but not including, ARGth occurrence of CHAR." t) + + (global-set-key (kbd "M-z") 'zap-up-to-char) +#+end_src + +*** Other "[[https://git.sr.ht/~technomancy/better-defaults/tree/master/better-defaults.el][better defaults]]" + +#+begin_src emacs-lisp + (cuss save-interprogram-paste-before-kill t) + (cuss apropos-do-all t) + (cuss mouse-yank-at-point t) + (cuss require-final-newline t) + (cuss visible-bell (not (string= (system-name) "larry"))) + (cuss ediff-window-setup-function #'ediff-setup-windows-plain) +#+end_src + * Persistence ** Auto-saves @@ -469,7 +501,12 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if- #+begin_src emacs-lisp (cuss backup-directory-alist - `((".*" . ,(no-littering-expand-var-file-name "backup/")))) + `((".*" . ,(no-littering-expand-var-file-name "backup/")))) + + (cuss backup-by-copying 1) + (cuss delete-old-versions -1) + (cuss version-control t) + (cuss vc-make-backup-files t) #+end_src ** Recent files @@ -506,8 +543,8 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if- (use-package saveplace :custom (save-place-file (no-littering-expand-var-file-name "places")) - (save-place-forget-unreadable-files (not - (eq system-type 'windows-nt)) + (save-place-forget-unreadable-files (not + (eq system-type 'windows-nt)) :config (save-place-mode 1))) #+end_src @@ -522,6 +559,8 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if- search-ring regexp-search-ring)) (savehist-save-minibuffer-history t) + (history-length t) + (history-delete-duplicates t) :config (savehist-mode 1)) #+end_src @@ -548,17 +587,24 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if- I'm going to be honest -- most of this is a stab in the dark. #+begin_src emacs-lisp - (prefer-coding-system 'utf-8-unix) - (set-default-coding-systems 'utf-8-unix) - (set-terminal-coding-system 'utf-8-unix) - (set-keyboard-coding-system 'utf-8-unix) - (set-selection-coding-system 'utf-8-unix) - (set-file-name-coding-system 'utf-8-unix) - (set-clipboard-coding-system 'utf-8-unix) - (set-buffer-file-coding-system 'utf-8-unix) - (cuss locale-coding-system 'utf-8-unix) - (cuss x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) + (set-language-environment 'utf-8) + (set-terminal-coding-system 'utf-8) + (cuss locale-coding-system 'utf-8) + (set-default-coding-systems 'utf-8) + (set-selection-coding-system 'utf-8) + (prefer-coding-system 'utf-8) + + ;; from https://www.emacswiki.org/emacs/EndOfLineTips + + (defun acdw/no-junk-please-were-unixish () + "Convert line endings to UNIX, dammit." + (let ((coding-str (symbol-name buffer-file-coding-system))) + (when (string-match "-\\(?:dos\\|mac\\)$" coding-str) + (set-buffer-file-coding-system 'unix)))) + + (add-hook 'find-file-hooks #'acdw/no-junk-please-were-unixish) #+end_src + ** Undo #+begin_src emacs-lisp @@ -596,6 +642,19 @@ I'm going to be honest -- most of this is a stab in the dark. ("C-+" . er/contract-region)) #+end_src +** Clean up white space on save + +#+begin_src emacs-lisp + (add-hook 'before-save-hook #'whitespace-cleanup) + (add-hook 'before-save-hook #'delete-trailing-whitespace) +#+end_src + +** Automatically revert a file to what it is on disk + +#+begin_src emacs-lisp + (global-auto-revert-mode 1) +#+end_src + * Writing ** Word count -- cgit 1.4.1-21-gabe81 From 6a2a0d46e63c0198d9e1164e5a74e776341b4375 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:33:37 -0600 Subject: Ensure blank lines in Org Mode --- config.org | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 154 insertions(+), 1 deletion(-) diff --git a/config.org b/config.org index c90e586..d8f0325 100644 --- a/config.org +++ b/config.org @@ -698,9 +698,162 @@ I'm going to be honest -- most of this is a stab in the dark. (org-pretty-entities t)) #+end_src +*** Ensure blank lines between headings and before contents + +from [[https://github.com/alphapapa/unpackaged.el#ensure-blank-lines-between-headings-and-before-contents][unpackaged.el]] + +#+begin_src emacs-lisp + ;;;###autoload + (defun unpackaged/org-fix-blank-lines (&optional prefix) + "Ensure that blank lines exist between headings and between + headings and their contents. With prefix, operate on whole + buffer. Ensures that blank lines exist after each headings's + drawers." + (interactive "P") + (org-map-entries + (lambda () + (org-with-wide-buffer + ;; `org-map-entries' narrows the buffer, which prevents us + ;; from seeing newlines before the current heading, so we + ;; do this part widened. + (while (not (looking-back "\n\n" nil)) + ;; Insert blank lines before heading. + (insert "\n"))) + (let ((end (org-entry-end-position))) + ;; Insert blank lines before entry content. + (forward-line) + (while (and (org-at-planning-p) + (< (point) (point-max))) + ;; Skip planning lines + (forward-line)) + (while (re-search-forward org-drawer-regexp end t) + ;; Skip drawers. You might think that + ;; `org-at-drawer-p' would suffice, but for some reason + ;; it doesn't work correctly when operating on hidden + ;; text. This works, taken from + ;; `org-agenda-get-some-entry-text'. + (re-search-forward "^[ \t]*:END:.*\n?" end t) + (goto-char (match-end 0))) + (unless (or (= (point) (point-max)) + (org-at-heading-p) + (looking-at-p "\n")) + (insert "\n")))) + t (if prefix + nil + 'tree))) +#+end_src + +*** ~org-return-dwim~ + +from [[https://github.com/alphapapa/unpackaged.el#org-return-dwim][unpackaged.el]] + +#+begin_src emacs-lisp + (defun unpackaged/org-element-descendant-of (type element) + "Return non-nil if ELEMENT is a descendant of TYPE. + TYPE should be an element type, like `item' or `paragraph'. + ELEMENT should be a list like that returned by + `org-element-context'." + ;; MAYBE: Use `org-element-lineage'. + (when-let* ((parent (org-element-property :parent element))) + (or (eq type (car parent)) + (unpackaged/org-element-descendant-of type parent)))) + + ;;;###autoload + (defun unpackaged/org-return-dwim (&optional default) + "A helpful replacement for `org-return'. With prefix, call `org-return'. + + On headings, move point to position after entry content. In + lists, insert a new item or end the list, with checkbox if + appropriate. In tables, insert a new row or end the table." + ;; Inspired by John Kitchin: http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/ + (interactive "P") + (if default + (org-return) + (cond + ;; Act depending on context around point. + + ;; NOTE: I prefer RET to not follow links, but by uncommenting this block, + ;; links will be followed. + + ;; ((eq 'link (car (org-element-context))) + ;; ;; Link: Open it. + ;; (org-open-at-point-global)) + + ((org-at-heading-p) + ;; Heading: Move to position after entry content. + ;; NOTE: This is probably the most interesting feature of this function. + (let ((heading-start (org-entry-beginning-position))) + (goto-char (org-entry-end-position)) + (cond ((and (org-at-heading-p) + (= heading-start (org-entry-beginning-position))) + ;; Entry ends on its heading; add newline after + (end-of-line) + (insert "\n\n")) + (t + ;; Entry ends after its heading; back up + (forward-line -1) + (end-of-line) + (when (org-at-heading-p) + ;; At the same heading + (forward-line) + (insert "\n") + (forward-line -1)) + ;; FIXME: looking-back is supposed to be called with more arguments. + (while (not (looking-back (rx (repeat 3 (seq (optional blank) "\n"))))) + (insert "\n")) + (forward-line -1))))) + + ((org-at-item-checkbox-p) + ;; Checkbox: Insert new item with checkbox. + (org-insert-todo-heading nil)) + + ((org-in-item-p) + ;; Plain list. Yes, this gets a little complicated... + (let ((context (org-element-context))) + (if (or (eq 'plain-list (car context)) ; First item in list + (and (eq 'item (car context)) + (not (eq (org-element-property :contents-begin context) + (org-element-property :contents-end context)))) + (unpackaged/org-element-descendant-of 'item context)) ; Element in list item, e.g. a link + ;; Non-empty item: Add new item. + (org-insert-item) + ;; Empty item: Close the list. + ;; TODO: Do this with org functions rather than operating on the text. Can't seem to find the right function. + (delete-region (line-beginning-position) (line-end-position)) + (insert "\n")))) + + ((when (fboundp 'org-inlinetask-in-task-p) + (org-inlinetask-in-task-p)) + ;; Inline task: Don't insert a new heading. + (org-return)) + + ((org-at-table-p) + (cond ((save-excursion + (beginning-of-line) + ;; See `org-table-next-field'. + (cl-loop with end = (line-end-position) + for cell = (org-element-table-cell-parser) + always (equal (org-element-property :contents-begin cell) + (org-element-property :contents-end cell)) + while (re-search-forward "|" end t))) + ;; Empty row: end the table. + (delete-region (line-beginning-position) (line-end-position)) + (org-return)) + (t + ;; Non-empty row: call `org-return'. + (org-return)))) + (t + ;; All other cases: call `org-return'. + (org-return))))) + + (bind-key "RET" #'unpackaged/org-return-dwim 'org-mode-map) +#+end_src + * Coding -** Indenting +** Formatting + +*** Indenting #+begin_src emacs-lisp (use-package aggressive-indent -- cgit 1.4.1-21-gabe81 From 683e72fd2af84fc4fd1b9ff551792fa7c979487c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:33:52 -0600 Subject: Add Smart Tabs --- config.org | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config.org b/config.org index d8f0325..a825f03 100644 --- a/config.org +++ b/config.org @@ -861,6 +861,19 @@ from [[https://github.com/alphapapa/unpackaged.el#org-return-dwim][unpackaged.el (global-aggressive-indent-mode 1)) #+end_src +*** Smart tabs + +#+begin_src emacs-lisp + (use-package smart-tabs-mode + :custom + (whitespace-style + '(face trailing tabs spaces lines newline + empty indentation space-before-tab + space-mark tab-mark newline-mark)) + :config + (smart-tabs-insinuate 'c 'c++ 'javascript 'java 'ruby)) +#+end_src + ** Display *** Prettify symbols mode -- cgit 1.4.1-21-gabe81 From e6234932311c99fd0bc20816f4e9009b5e04ab5c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:33:57 -0600 Subject: Add Rainbow mode --- config.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config.org b/config.org index a825f03..68aa3e1 100644 --- a/config.org +++ b/config.org @@ -910,6 +910,15 @@ from [[https://github.com/alphapapa/unpackaged.el#org-return-dwim][unpackaged.el :hook (prog-mode . rainbow-delimiters-mode)) #+end_src +*** Rainbow mode + +#+begin_src emacs-lisp + (use-package rainbow-mode + :custom + (rainbow-x-colors nil) + :hook prog-mode) +#+end_src + *** Line numbers #+begin_src emacs-lisp -- cgit 1.4.1-21-gabe81 From df8c237fd5bca8df18ac12439c00af9feb8a4ad1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:34:03 -0600 Subject: Change minimum display-line-numbers-width --- config.org | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index 68aa3e1..d6ad3d0 100644 --- a/config.org +++ b/config.org @@ -926,8 +926,10 @@ from [[https://github.com/alphapapa/unpackaged.el#org-return-dwim][unpackaged.el "Enable line numbers, either through `display-line-numbers-mode' or through `linum-mode'." (if (and (fboundp 'display-line-numbers-mode) - (display-graphic-p)) - (display-line-numbers-mode 1) + (display-graphic-p)) + (progn + (display-line-numbers-mode 1) + (cuss display-line-numbers-width 2)) (linum-mode 1))) (add-hook 'prog-mode-hook #'acdw/enable-line-numbers) -- cgit 1.4.1-21-gabe81 From 600d4456067ddff50cdb4d279eb7ea9a0828265e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:34:25 -0600 Subject: Whitespace --- config.org | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config.org b/config.org index d6ad3d0..f0aa5b5 100644 --- a/config.org +++ b/config.org @@ -950,14 +950,14 @@ from [[https://github.com/alphapapa/unpackaged.el#org-return-dwim][unpackaged.el #+begin_src emacs-lisp (define-advice magit-list-refs (:around (orig &optional namespaces format sortby) - prescient-sort) + prescient-sort) "Apply prescient sorting when listing refs." (let ((res (funcall orig namespaces format sortby))) (if (or sortby - magit-list-refs-sortby - (not selectrum-should-sort-p)) - res - (prescient-sort res)))) + magit-list-refs-sortby + (not selectrum-should-sort-p)) + res + (prescient-sort res)))) #+end_src *** Use =libgit= when I can build it (requires =cmake=) -- cgit 1.4.1-21-gabe81 From 8d99dceecd7e535493e5b48463064fd1813a0693 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:34:32 -0600 Subject: Don't load 'forge' on Windows There's a SQL error? --- config.org | 1 + 1 file changed, 1 insertion(+) diff --git a/config.org b/config.org index f0aa5b5..08d4cc7 100644 --- a/config.org +++ b/config.org @@ -973,6 +973,7 @@ from [[https://github.com/alphapapa/unpackaged.el#org-return-dwim][unpackaged.el #+begin_src emacs-lisp (use-package forge :after magit + :unless (eq system-type 'windows-nt) :custom (forge-owned-accounts '(("duckwork")))) -- cgit 1.4.1-21-gabe81 From 62da8a3aefea2368844b191755d8677a79abf800 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:34:52 -0600 Subject: Whitespaceeeeeeee --- config.org | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config.org b/config.org index 08d4cc7..da8d81a 100644 --- a/config.org +++ b/config.org @@ -989,14 +989,14 @@ from [[https://github.com/alphapapa/unpackaged.el#org-return-dwim][unpackaged.el *** Lisps -**** SLIME +**** Common Lisp (SLIME) #+begin_src emacs-lisp (use-package slime - :when (executable-find "sbcl") - :custom - (inferior-lisp-program "sbcl") - (slime-contribs '(slime-fancy))) + :when (executable-find "sbcl") + :custom + (inferior-lisp-program "sbcl") + (slime-contribs '(slime-fancy))) #+end_src **** Fennel @@ -1019,9 +1019,9 @@ from [[https://github.com/alphapapa/unpackaged.el#org-return-dwim][unpackaged.el #+begin_src emacs-lisp (use-package web-mode :mode (("\\.ts\\'" . web-mode) - ("\\.html?\\'" . web-mode) - ("\\.css?\\'" . web-mode) - ("\\.js\\'" . web-mode))) + ("\\.html?\\'" . web-mode) + ("\\.css?\\'" . web-mode) + ("\\.js\\'" . web-mode))) #+end_src *** =~/.ssh/config= -- cgit 1.4.1-21-gabe81 From e35f0a283a3e2e798cc5987dbdb99c925a6ff2e6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:34:59 -0600 Subject: Add Go Mode --- config.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config.org b/config.org index da8d81a..f77967f 100644 --- a/config.org +++ b/config.org @@ -1030,6 +1030,13 @@ from [[https://github.com/alphapapa/unpackaged.el#org-return-dwim][unpackaged.el (use-package ssh-config-mode) #+end_src +*** Go + +#+begin_src emacs-lisp + (use-package go-mode + :mode "\\.go\\'") +#+end_src + * Applications ** Elpher -- cgit 1.4.1-21-gabe81 From df2483866b4e87faabd3902a5ee50f1ff6e7357f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 08:35:04 -0600 Subject: Elpher headings match modus headings --- config.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config.org b/config.org index f77967f..e24b1a7 100644 --- a/config.org +++ b/config.org @@ -1049,6 +1049,13 @@ from [[https://github.com/alphapapa/unpackaged.el#org-return-dwim][unpackaged.el (elpher-certificate-directory (no-littering-expand-var-file-name "elpher-certificates/")) (elpher-ipv4-always t) + :custom-face + (elpher-gemini-heading1 + ((t (:inherit (modus-theme-heading-1))))) + (elpher-gemini-heading2 + ((t (:inherit (modus-theme-heading-2))))) + (elpher-gemini-heading3 + ((t (:inherit (modus-theme-heading-3))))) :config (defun elpher:eww-browse-url (original url &optional new-window) "Handle gemini/gopher links with eww." -- cgit 1.4.1-21-gabe81 From 884f6c741bfb22b1aa31c8052101dbc5b5ca592f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 18:51:30 -0600 Subject: Make acdw/setup-fonts interactive --- config.org | 1 + 1 file changed, 1 insertion(+) diff --git a/config.org b/config.org index e24b1a7..630c811 100644 --- a/config.org +++ b/config.org @@ -306,6 +306,7 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if- "Setup fonts. This has to happen after the frame is set up for the first time, so add it to `focus-in-hook'. It removes itself." + (interactive) (set-face-attribute 'default nil :font (font-candidate -- cgit 1.4.1-21-gabe81 From 3adcb62787d0e30ef1f3f16f7f4ab7207af8d6e4 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 18:51:47 -0600 Subject: Remove Go from font-candidates --- config.org | 1 - 1 file changed, 1 deletion(-) diff --git a/config.org b/config.org index 630c811..31e275a 100644 --- a/config.org +++ b/config.org @@ -328,7 +328,6 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if- (font-candidate "Libertinus Serif-14" "Linux Libertine O-12" - "Go-12" "Georgia-11")) (remove-hook 'focus-in-hook #'acdw/setup-fonts)) -- cgit 1.4.1-21-gabe81 From 197d4dd36a983576e64b6b224640d0abf2b18704 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 18:52:29 -0600 Subject: Add so-long-mode --- config.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config.org b/config.org index 31e275a..9e78a67 100644 --- a/config.org +++ b/config.org @@ -484,6 +484,13 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if- (cuss ediff-window-setup-function #'ediff-setup-windows-plain) #+end_src +*** So-long-mode + +#+begin_src emacs-lisp + (if (boundp 'global-so-long-mode) + (global-so-long-mode)) +#+end_src + * Persistence ** Auto-saves -- cgit 1.4.1-21-gabe81 From 72ef053d8904294b34b14bacc055c9d93952329f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 18:52:38 -0600 Subject: Change binding for just-one-space to cycle-space --- config.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config.org b/config.org index 9e78a67..f9da6ba 100644 --- a/config.org +++ b/config.org @@ -491,6 +491,16 @@ See [[https://emacs.stackexchange.com/questions/12351/when-to-call-find-font-if- (global-so-long-mode)) #+end_src +*** Change =just-one-space= to =cycle-space= + +#+begin_src emacs-lisp + (defun acdw/cycle-spacing-1 () + (interactive) + (cycle-spacing -1)) + + (bind-key [remap just-one-space] #'acdw/cycle-spacing-1) +#+end_src + * Persistence ** Auto-saves -- cgit 1.4.1-21-gabe81 From 7a1ffa0bdee9bb219c8e3d9ee780537ce4b9f34c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 18:52:55 -0600 Subject: Change faces for elpher headings --- config.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config.org b/config.org index f9da6ba..58d75c6 100644 --- a/config.org +++ b/config.org @@ -1093,6 +1093,13 @@ from [[https://github.com/alphapapa/unpackaged.el#org-return-dwim][unpackaged.el :straight (gemini-mode :repo "https://git.carcosa.net/jmcbray/gemini.el.git") :mode "\\.\\(gemini|gmi\\)\\'" + :custom-face + (gemini-heading-face-1 + ((t (:inherit (elpher-gemini-heading1))))) + (gemini-heading-face2 + ((t (:inherit (elpher-gemini-heading2))))) + (gemini-heading-face3 + ((t (:inherit (elpher-gemini-heading3))))) :hook (gemini-mode . visual-fill-column-mode)) -- cgit 1.4.1-21-gabe81 From 4358b821521eca3e568b626e6666f807f9144979 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Nov 2020 18:54:25 -0600 Subject: Remove whitespace after TITLE, AUTHOR --- config.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index 58d75c6..48d683c 100644 --- a/config.org +++ b/config.org @@ -1,5 +1,5 @@ -#+TITLE: Emacs configuration, literate style -#+AUTHOR: Case Duckworth +#+TITLE:Emacs configuration, literate style +#+AUTHOR:Case Duckworth #+PROPERTY: header-args :tangle init.el #+OPTIONS: toc:nil #+BANKRUPTCY_COUNT: 2 -- cgit 1.4.1-21-gabe81