From c40e3c70c08f8092be944862a76e05c30c8c17fb Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 7 Oct 2020 19:23:00 -0500 Subject: Reorganize --- init.el | 710 +++++++++++++++++++++++++++++----------------------------------- 1 file changed, 320 insertions(+), 390 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 6010297..f5a9bbd 100644 --- a/init.el +++ b/init.el @@ -6,60 +6,177 @@ ;; which pointed out that I could use `outline-mode' (or in my case, ;; `outshine') to fold and navigate a pure-elisp `init.el'. So that's ;; what I'm doing. +;;; Custom Functions +(defun acdw/split-and-follow-window-below () + "Split the window below and switch to the split." + (interactive) + (split-window-below) + (balance-windows) + (other-window 1)) + +(defun acdw/split-and-follow-window-right () + "Split the window right and switch to the split." + (interactive) + (split-window-right) + (balance-windows) + (other-window 1)) + +(defun acdw/full-auto-save () + "Save all buffers that (a) have files associated and (b) are modified." + (interactive) + (save-excursion + (dolist (buf (buffer-list)) + (set-buffer buf) + (if (and (buffer-file-name) (buffer-modified-p)) + (basic-save-buffer))))) + +(defun acdw/kill-this-buffer () + "Kill the current buffer." + (interactive) + (kill-buffer nil)) + +;; https://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/ +(defun acdw/stop-gc () + "Stop garbage collection by setting it to a very high number." + (setq gc-cons-threshold most-positive-fixnum)) + +(defun acdw/start-gc () + "Start garbage collection by resetting it to `*acdw/gc-cons*'." + (setq gc-cons-threshold *acdw/gc-cons*)) + +(defun post-to-gemlog-blue (post-title user pass) + "Post current buffer to gemlog.blue." + (interactive + (let* ((title-maybe (progn ;; TODO this is ... clunky + (goto-char (point-min)) + (if (re-search-forward "^# \\(.*\\)" nil t) + (buffer-substring-no-properties + (match-beginning 1) + (match-end 1)) + ""))) + (title (read-string + (format "Title%s: " + (if (string= "" title-maybe) + "" + (concat " (" title-maybe ")"))) + nil nil title-maybe)) + (user (read-string "User: " nil)) + (pass (read-passwd "Pass: " nil))) + (list title user pass))) + + (require 'mm-url) + (let ((url-request-method "POST") + (url-request-extra-headers + '(("Content-Type" . "application/x-www-form-urlencoded"))) + (url-request-data + (mm-url-encode-www-form-urlencoded + `(("title" . ,post-title) + ("gemloguser" . ,user) + ("pw" . ,pass) + ("post" . ,(buffer-string)))))) + (with-current-buffer + (url-retrieve-synchronously "https://gemlog.blue/post.php") + (goto-char (point-min)) + (re-search-forward "\\(gemini://.*\\.gmi\\)") + (elpher-go (match-string 1))))) ;;; Basic emacs config & built-in packages ;;;; /Really/ basic emacs config -;; I /did/ use `better-defaults', but it turns out that that package -;; is (a) short and (b) mostly overriden by other settings. -(use-package emacs - :demand ; make sure this stuff loads - :init - ;; where I am - (setq calendar-location-name "Baton Rouge, LA") - (setq calendar-latitude 30.39) - (setq calendar-longitude -91.83) +(use-package calendar + :straight nil + :custom + (calendar-location-name "Baton Rouge, LA") + (calendar-latitude 30.39) + (calendar-longitude -91.83)) - ;; firefox is love, firefox is life - (setq browse-url-browser-function 'browse-url-firefox - browse-url-new-window-flag t - browse-url-firefox-new-window-is-tab t) +(use-package browse-url + :straight nil + :custom + (browse-url-browser-function 'browse-url-firefox) + (browse-url-new-window-flag t) + (browse-url-firefox-new-window-is-tab t)) - ;; honestly not sure if this is necessary - (autoload 'zap-up-to-char "misc" - "Kill up to, but not including, ARGth occurence of CHAR." t) +(use-package paren + :straight nil + :custom + (show-paren-style 'mixed) + :hook + (after-init-hook . show-paren-mode)) - ;; show parentheses - (setq show-paren-style 'mixed) - (show-paren-mode) +(use-package simple + :straight nil + :custom + (save-interprogram-paste-before-kill + t "Save existing clipboard text into killring before replacing it.") + :hook + (after-init-hook . global-visual-line-mode)) - ;; always work on visual lines - (global-visual-line-mode) +(use-package delsel + :straight nil + :hook + (after-init-hook . delete-selection-mode)) - ;; make the mouse avoid where I'm typing - (mouse-avoidance-mode 'jump) +(use-package emacs + :straight nil + :demand t + :custom + ;; completion + (completion-ignore-case t) + (read-buffer-completion-ignore-case t) + (read-file-name-completion-ignore-case t) + ;; etc. + (indent-tabs-mode nil "Indentation won't insert tabs.") + (visible-bell (not *acdw/at-larry*) "Don't ring a bell, unless at larry.") + (use-dialog-box nil "Ask questions in the modeline.") + (mark-even-if-inactive nil "Don't use the mark when inactive.") + ;; paragraphs + (sentence-end-double-space t "Sentences end with two spaces.") + ;; cursor + (cursor-type 'bar) + (cursor-in-non-selected-windows 'hollow) + (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))) + (inhibit-startup-buffer-menu t) + (inhibit-startup-screen t) + (initial-buffer-choice t "Start out in *scratch*.") + (initial-scratch-message nil) + :config + (fset 'yes-or-no-p 'y-or-n-p) + (blink-cursor-mode 0) + :bind + ("C-z" . nil) + ("C-x k" . acdw/kill-this-buffer) + ("C-x K" . kill-buffer) + :hook + (prog-mode-hook . prettify-symbols-mode) + ((auto-save-hook focus-out-hook) . acdw/full-auto-save) + (before-save-hook . delete-trailing-whitespace) + (minibuffer-setup-hook . acdw/stop-gc) + (minibuffer-exit-hook . acdw/start-gc)) - ;; delete the selection when I start typing, like a normal editor - (delete-selection-mode) +(use-package display-line-numbers + :straight nil + :when (and (fboundp 'display-line-numbers-mode) + (display-graphic-p)) + :hook + (prog-mode-hook . display-line-numbers-mode)) - ;; ignore case - (setq-default completion-ignore-case t - read-buffer-completion-ignore-case t - read-file-name-completion-ignore-case t) +(use-package linum + :straight nil + :unless (and (fboundp 'display-line-numbers-mode) + (display-graphic-p)) + :hook + (prog-mode-hook . linum-mode)) - ;; etc defaults - (fset 'yes-or-no-p 'y-or-n-p) - (setq-default indent-tabs-mode nil - save-interprogram-paste-before-kill t - apropos-do-all t - mouse-yank-at-point t - require-final-newline t - visible-bell (not *acdw/at-larry*) - ediff-window-setup-function 'ediff-setup-windows-plain - use-dialog-box nil - mark-even-if-inactive nil - sentence-end-double-space t) - - ;; utf-8 is now, old man +(use-package mule + :straight nil + :init (set-charset-priority 'unicode) (set-language-environment "UTF-8") (set-default-coding-systems 'utf-8) @@ -67,101 +184,45 @@ (set-keyboard-coding-system 'utf-8) (set-selection-coding-system 'utf-8) (prefer-coding-system 'utf-8) - (setq default-buffer-file-coding-system 'utf-8 - default-process-coding-system '(utf-8-unix . utf-8-unix) - locale-coding-system 'utf-8) - - ;; don't confirm killing - (setq confirm-kill-processes nil - confirm-kill-emacs nil) - - ;; simplify the GUI - (setq 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)) - inhibit-startup-buffer-menu t - inhibit-startup-screen t - initial-buffer-choice t - initial-scratch-message nil) - - ;; set up the cursor - (blink-cursor-mode 0) - (setq-default cursor-type 'bar - cursor-in-non-selected-windows 'hollow) - - ;; display line numbers in `prog-mode' - (add-hook 'prog-mode-hook - (if (and (fboundp 'display-line-numbers-mode) - (display-graphic-p)) - #'display-line-numbers-mode - #'linum-mode)) - - ;; custom functions - (defun split-and-follow-below () - "Split the window below and switch to the split." - (interactive) - (split-window-below) - (balance-windows) - (other-window 1)) - - (defun split-and-follow-right () - "Split the window right and switch to the split." - (interactive) - (split-window-right) - (balance-windows) - (other-window 1)) - - (defun full-auto-save () - "Save all buffers that (a) have files associated and (b) are modified." - (interactive) - (save-excursion - (dolist (buf (buffer-list)) - (set-buffer buf) - (if (and (buffer-file-name) (buffer-modified-p)) - (basic-save-buffer))))) - - (defun kill-this-buffer () - "Kill the current buffer." - (interactive) - (kill-buffer nil)) + :custom + (default-buffer-file-coding-system 'utf-8) + (default-process-coding-system '(utf-8-unix . utf-8-unix)) + (locale-coding-system 'utf-8)) + +(use-package mouse + :straight nil + :custom + (mouse-yank-at-point t "Yank at point instead of click.")) +(use-package files + :straight nil + :custom + (require-final-newline t) + (confirm-kill-processes nil) + (confirm-kill-emacs nil) :bind - ("C-x C-b" . ibuffer) - ("M-z" . zap-up-to-char) - ([remap split-window-below] . split-and-follow-below) - ([remap split-window-right] . split-and-follow-right) - ("C-x f" . find-file) - ("C-z" . nil) - ("C-x k" . kill-this-buffer) - ("C-x K" . kill-buffer) + ("C-x f" . find-file)) - :hook - (prog-mode-hook . prettify-symbols-mode) - ((auto-save-hook focus-out-hook) . full-auto-save) - (before-save-hook . delete-trailing-whitespace)) +(use-package window + :straight nil + :bind + ([remap split-window-below] . acdw/split-and-follow-window-below) + ([remap split-window-right] . acdw/split-and-follow-window-right)) ;;;; Keep .emacs.d clean ;; load this early for other packages to use (use-package no-littering :demand + :custom + (create-lockfiles nil) + (delete-old-versions t) + (kept-new-versions 6) + (kept-old-versions 2) + (version-control t) :config (setq custom-file (no-littering-expand-etc-file-name "custom.el")) - - (setq create-lockfiles nil) - - (setq delete-old-versions t - kept-new-versions 6 - kept-old-versions 2 - version-control t) - (setq backup-directory-alist `((".*" . ,(no-littering-expand-var-file-name "backup/")))) - (setq auto-save-file-name-transforms `((".*" ,(no-littering-expand-var-file-name "auto-save/") t))) (auto-save-mode)) @@ -169,49 +230,51 @@ ;;;; Uniquily name buffers (use-package uniquify :straight nil - :init - (setq uniquify-buffer-name-style 'forward)) + :custom + (uniquify-buffer-name-style 'forward)) ;;;; Use async when possible (use-package async - :config + :config ;; not sure when this is loaded (dired-async-mode)) ;;;; Autocompile elisp files (like this one) (use-package auto-compile - :init - (setq load-prefer-newer t) - :config - (auto-compile-on-load-mode)) + :custom + (load-prefer-newer t) + :hook + (emacs-lisp-mode-hook . (lambda () + (auto-compile-on-load-mode) + (auto-compile-on-save-mode)))) ;;;; Recent files (use-package recentf - :init - (setq recentf-max-menu-items 100 - recentf-max-saved-items 100) :config (add-to-list 'recentf-exclude no-littering-var-directory) (add-to-list 'recentf-exclude no-littering-etc-directory) - (recentf-mode)) + :custom + (recentf-max-menu-items 100) + (recentf-max-saved-items 100) + :hook + (after-init-hook . recentf-mode)) ;;;; Save places in files (use-package saveplace - :init - (setq save-place-file (no-littering-expand-var-file-name "places")) - (when *acdw/at-work* - (setq save-place-forget-unreadable-files nil)) - :config - (save-place-mode)) + :custom + (save-place-file (no-littering-expand-var-file-name "places")) + (save-place-forget-unreadable-files (not *acdw/at-work*)) + :hook + (after-init-hook . save-place-mode)) ;;;; Save history of commands, etc. (use-package savehist - :init - (setq savehist-additional-variables - '(kill-ring - search-ring - regexp-search-ring)) - :config - (savehist-mode)) + :custom + (savehist-additional-variables + '(kill-ring + search-ring + regexp-search-ring)) + :hook + (after-init-hook . savehist-mode)) ;;;; Authority sources for logins ;; TODO: use gpg @@ -234,11 +297,10 @@ ;;;;; Pop-up help for keys (use-package which-key :diminish which-key-mode - :init - (setq which-key-enable-extended-define-key t) - :config - (which-key-setup-side-window-right-bottom) - (which-key-mode)) + :custom + (which-key-enable-extended-define-key t) + :hook + (after-init-hook . which-key-mode)) ;;;;; A better help buffer (use-package helpful @@ -252,8 +314,8 @@ ;;;;; A better `outline-mode' (use-package outshine - :init - (setq outshine-cycle-emulate-tab t) + :custom + (outshine-cycle-emulate-tab t) :bind (:map outshine-mode-map ("" . outshine-cycle-buffer) ("" . outshine-cycle-buffer)) @@ -262,80 +324,81 @@ ;;;;; Item selection & narrowing (use-package selectrum + :custom + (enable-recursive-minibuffers t) :init - (setq enable-recursive-minibuffers t) (minibuffer-depth-indicate-mode) - :config - (selectrum-mode)) + :hook + (after-init-hook . selectrum-mode)) (use-package prescient) (use-package selectrum-prescient - :config - (selectrum-prescient-mode) - (prescient-persist-mode)) + :hook + (after-init-hook . (lambda () + (selectrum-prescient-mode) + (prescient-persist-mode)))) ;;;;; Searching (use-package ctrlf - :config - (ctrlf-mode)) + :hook + (after-init-hook . ctrlf-mode)) ;;;;; Visually switch windows -(use-package switch-window - :init - (setq switch-window-shortcut-style 'qwerty) +(use-package ctrlxo + :straight (ctrlxo + :host github + :repo "muffinmad/emacs-ctrlxo") :bind - ([remap other-window] . switch-window) - ("s-o" . switch-window)) + ([remap other-window] . ctrlxo)) ;;;; Theming, looks, fonts ;;;;; Fonts -;; I'm doing these outside of any 'package' b/c ... idk. I want to? -(let* ((fixed-pitch-sans-serif-family - (cond ((x-list-fonts "Fira Code") '(:family "Fira Code")) - ((x-list-fonts "Consolas") '(:family "Consolas")) - ((x-list-fonts "DejaVu Sans Mono") '(:family "DejaVu Sans Mono")) - ((x-list-fonts "Fixed") '(:family "Fixed")) - (nil (warn "Can't find a good fixed pitch sans-serif font.")))) - (fixed-pitch-serif-family - (cond ((x-list-fonts "Go Mono") '(:family "Go Mono")) - ((x-list-fonts "Courier Prime") '(:family "Courier Prime")) - ((x-list-fonts "Courier New") '(:family "Courier New")) - ((x-list-fonts "Courier") '(:family "Courier")) - (nil (warn "Can't find a good fixed pitch serif font.")))) - (variable-pitch-sans-serif-family - (cond ((x-list-fonts "DejaVu Sans") '(:family "DejaVu Sans")) - ((x-list-fonts "Go") '(:family "Go")) - ((x-list-fonts "Arial") '(:family "Arial")) - (nil (warn "Cant't find a good variable pitch sans-serif font.")))) - (variable-pitch-serif-family - (cond ((x-list-fonts "DejaVu Serif") '(:family "DejaVu Serif")) - ((x-list-fonts "Georgia") '(:family "Georgia")) - ((x-list-fonts "Times New Roman") '(:family "Times New Roman")) - ((x-list-fonts "Times") '(:family "Times")) - (nil (warn "Can't find a good variable pitch serif font.")))) - - (fixed-pitch-family fixed-pitch-sans-serif-family) - (variable-pitch-family variable-pitch-serif-family) - (default-family fixed-pitch-family)) - (custom-theme-set-faces - 'user - `(fixed-pitch ((t (,@fixed-pitch-family)))) - `(fixed-pitch-serif ((t (,@fixed-pitch-serif-family)))) - `(variable-pitch ((t (,@variable-pitch-family)))) - `(default ((t (,@default-family)))))) +;; https://github.com/kaushalmodi/.emacs.d/blob/master/init.el#L376 +;; modi/font-check +(defun acdw/setup-fonts () + (let* ((fixed-pitch-sans-serif-family + (cond ((x-list-fonts "Fira Code") '(:family "Fira Code")) + ((x-list-fonts "Consolas") '(:family "Consolas")) + ((x-list-fonts "DejaVu Sans Mono") '(:family "DejaVu Sans Mono")) + ((x-list-fonts "Fixed") '(:family "Fixed")) + (nil (warn "Can't find a good fixed pitch sans-serif font.")))) + (fixed-pitch-serif-family + (cond ((x-list-fonts "Go Mono") '(:family "Go Mono")) + ((x-list-fonts "Courier Prime") '(:family "Courier Prime")) + ((x-list-fonts "Courier New") '(:family "Courier New")) + ((x-list-fonts "Courier") '(:family "Courier")) + (nil (warn "Can't find a good fixed pitch serif font.")))) + (variable-pitch-sans-serif-family + (cond ((x-list-fonts "DejaVu Sans") '(:family "DejaVu Sans")) + ((x-list-fonts "Go") '(:family "Go")) + ((x-list-fonts "Arial") '(:family "Arial")) + (nil (warn "Cant't find a good variable pitch sans-serif font.")))) + (variable-pitch-serif-family + (cond ((x-list-fonts "DejaVu Serif") '(:family "DejaVu Serif")) + ((x-list-fonts "Georgia") '(:family "Georgia")) + ((x-list-fonts "Times New Roman") '(:family "Times New Roman")) + ((x-list-fonts "Times") '(:family "Times")) + (nil (warn "Can't find a good variable pitch serif font.")))) + + (fixed-pitch-family fixed-pitch-sans-serif-family) + (variable-pitch-family variable-pitch-serif-family) + (default-family fixed-pitch-family)) + (custom-theme-set-faces + 'user + `(fixed-pitch ((t (,@fixed-pitch-family)))) + `(fixed-pitch-serif ((t (,@fixed-pitch-serif-family)))) + `(variable-pitch ((t (,@variable-pitch-family)))) + `(default ((t (,@default-family)))))) + (remove-hook 'focus-in-hook #'acdw/setup-fonts)) +(add-hook 'focus-in-hook #'acdw/setup-fonts) ;;;;; Modeline (use-package doom-modeline - :init - (setq doom-modeline-icon nil - doom-modeline-enable-word-count t) - - ;; (when *acdw/at-larry* - ;; (setq display-time-format "%R") - ;; (display-time-mode)) - + :custom + (doom-modeline-icon nil) + (doom-modeline-enable-word-count t) :hook - (window-setup-hook . doom-modeline-mode)) + (after-init-hook . doom-modeline-mode)) ;;;;; Ligatures (use-package ligature @@ -358,22 +421,21 @@ ":=" "..." ":>" ":<" ">:" "<:" "::=" ;; add others here )) - (global-ligature-mode)) + :hook + (after-init-hook . global-ligature-mode)) ;;;;; Unicode (use-package unicode-fonts - :config - (unicode-fonts-setup)) + :hook + (after-init-hook . unicode-fonts-setup)) ;;;;; Modus themes (use-package modus-operandi-theme - :if window-system :config (load-theme 'modus-operandi t t) (defun acdw/sunrise () - (enable-theme 'modus-operandi) - (start-process-shell-command "light" nil "light -S 60")) + (enable-theme 'modus-operandi)) (if *acdw/at-work* (enable-theme 'modus-operandi) @@ -382,13 +444,11 @@ (when *acdw/at-home* (use-package modus-vivendi-theme - :if window-system :config (load-theme 'modus-vivendi t t) (defun acdw/sunset () - (enable-theme 'modus-vivendi) - (start-process-shell-command "light" nil "light -S 35")) + (enable-theme 'modus-vivendi)) (run-at-time (nth 4 (split-string (sunrise-sunset))) (* 60 60 24) #'acdw/sunset) @@ -403,8 +463,8 @@ ;;;;; Show text commands acted on (use-package volatile-highlights - :config - (volatile-highlights-mode)) + :hook + (after-init-hook . volatile-highlights-mode)) ;;;;; Visual replacement for `zap-to-char' (use-package zop-to-char @@ -420,8 +480,8 @@ ;;;;; Operate on the current line if no region is active (use-package whole-line-or-region - :config - (whole-line-or-region-global-mode)) + :hook + (after-init-hook . whole-line-or-region-global-mode)) ;;;;; Expand region (use-package expand-region @@ -432,9 +492,9 @@ ;;;;; Code completion (use-package company - :init - (setq company-idle-delay 0.1 - company-show-numbers t) + :custom + (company-idle-delay 0.1) + (company-show-numbers t) :config (let ((map company-active-map)) (mapc (lambda (x) @@ -459,7 +519,7 @@ ;;;;; Git integration (use-package magit - :if *acdw/at-home* + :when *acdw/at-home* :bind ("C-x g" . magit-status) :config @@ -474,7 +534,7 @@ ) (use-package forge - :if *acdw/at-home* + :when *acdw/at-home* :after magit :config (setq forge-owned-accounts '(("duckwork")))) @@ -489,9 +549,10 @@ ;;;;;; Smartly deal with pairs (use-package smartparens - :config - (require 'smartparens-config) - (smartparens-global-mode)) + :hook + (prog-mode-hook . (lambda () + (require 'smartparens-config) + (smartparens-global-mode)))) ;;;;;; Show delimiters as different colors (use-package rainbow-delimiters @@ -507,9 +568,9 @@ ;;;;; `fill-column', but in `visual-line-mode' (use-package visual-fill-column - :init - (setq split-window-preferred-function 'visual-fill-column-split-window-sensibly) - (setq visual-fill-column-center-text t) + :custom + (split-window-preferred-function 'visual-fill-column-split-window-sensibly) + (visual-fill-column-center-text t) :config (advice-add 'text-scale-adjust :after #'visual-fill-column-adjust)) @@ -521,13 +582,13 @@ ;;;;;; Edit files with `sudo' (I think?) (use-package su - :config - (su-mode)) + :hook + (after-init-hook . su-mode)) ;;;;;; Implement XDG Trash specification (use-package trashed - :init - (setq delete-by-moving-to-trash t)) + :custom + (delete-by-moving-to-trash t)) ;;;;;; Build exec-path from $PATH (use-package exec-path-from-shell @@ -554,150 +615,18 @@ (use-package gemini-mode :straight (gemini-mode - :repo "https://git.carcosa.net/jmcbray/gemini.el.git")) + :repo "https://git.carcosa.net/jmcbray/gemini.el.git") + :hook (gemini-mode-hook . (lambda () + ;; (variable-pitch-mode) + (set-fill-column 100) + (visual-fill-column-mode)))) (use-package gemini-write :straight (gemini-write :repo "https://alexschroeder.ch/cgit/gemini-write")) -(defun post-to-gemlog-blue (post-title user pass) - "Post current buffer to gemlog.blue." - (interactive - (let* ((title-maybe (progn ;; TODO this is ... clunky - (goto-char (point-min)) - (if (re-search-forward "^# \\(.*\\)" nil t) - (buffer-substring-no-properties - (match-beginning 1) - (match-end 1)) - ""))) - (title (read-string - (format "Title%s: " - (if (string= "" title-maybe) - "" - (concat " (" title-maybe ")"))) - nil nil title-maybe)) - (user (read-string "User: " nil)) - (pass (read-passwd "Pass: " nil))) - (list title user pass))) - - (require 'mm-url) - (let ((url-request-method "POST") - (url-request-extra-headers - '(("Content-Type" . "application/x-www-form-urlencoded"))) - (url-request-data - (mm-url-encode-www-form-urlencoded - `(("title" . ,post-title) - ("gemloguser" . ,user) - ("pw" . ,pass) - ("post" . ,(buffer-string)))))) - (with-current-buffer - (url-retrieve-synchronously "https://gemlog.blue/post.php") - (goto-char (point-min)) - (re-search-forward "\\(gemini://.*\\.gmi\\)") - (elpher-go (match-string 1))))) - -;;;; exwm ~ Emacs X Window Manager -;; (when *acdw/at-larry* -;; (use-package exwm -;; :if window-system -;; :demand -;; :init -;; (add-to-list 'default-frame-alist '(fullscreen . maximized))) -;; :custom -;; (exwm-layout-show-all-buffers t) -;; (exwm-workspace-warp-cursor t) -;; ;;(mouse-autoselect-window t) -;; (exwm-workspace-number 4) -;; (exwm-input-global-keys -;; `( -;; ([remap split-window-below] . split-and-follow-below) -;; ([remap split-window-right] . split-and-follow-right) -;; ([?\s-r] . exwm-reset) -;; ([?\s-w] . exwm-workspace-switch) -;; ([?\s-&] . (lambda (command) -;; (interactive (list (read-shell-command "$ "))) -;; (start-process-shell-command command nil command))) -;; ,@(mapcar (lambda (i) -;; `(,(kbd (format "s-%d" i)) . -;; (lambda () -;; (interactive) -;; (exwm-workspace-switch-create ,i)))) -;; (number-sequence 0 9)))) -;; (exwm-input-simulation-keys -;; '(([?\C-b] . [left]) -;; ([?\M-b] . [C-left]) -;; ([?\C-f] . [right]) -;; ([?\M-f] . [C-right]) -;; ([?\C-p] . [up]) -;; ([?\C-n] . [down]) -;; ([?\C-a] . [home]) -;; ([?\C-e] . [end]) -;; ([?\M-v] . [prior]) -;; ([?\C-v] . [next]) -;; ([?\C-d] . [delete]) -;; ([?\C-k] . [S-end delete]) -;; ([?\C-s] . [?\C-f]) -;; ([?\C-w] . [?\C-x]) -;; ([?\M-w] . [?\C-c]) -;; ([?\C-y] . [?\C-v]))) -;; :hook -;; ((exwm-update-class-hook . -;; (lambda () "Rename buffer to window's class name" -;; (exwm-workspace-rename-buffer exwm-class-name))) -;; (exwm-update-title-hook . -;; (lambda () "Update workspace name to window title" -;; (when (not exwm-instance-name) -;; (exwm-workspace-rename-buffer exwm-title)))) -;; (exwm-init-hook . window-divider-mode) -;; (exwm-init-hook . -;; (lambda () "Autostart" -;; (start-process-shell-command "cmst" nil "cmst -m -w 5") -;; (start-process-shell-command "keepassxc" nil "keepassxc") -;; (start-process-shell-command -;; "pa-applet" nil -;; "pa-applet --disable-key-grabbing --disable-notifications") -;; (start-process-shell-command -;; "cbatticon" nil "cbatticon")))) -;; :config -;; (require 'exwm) -;; (exwm-enable) -;; (require 'exwm-systemtray) -;; (exwm-systemtray-enable)) - -;; (use-package exwm-firefox-core -;; :after exwm -;; :straight (exwm-firefox-core -;; :type git -;; :host github -;; :repo "walseb/exwm-firefox-core")) - -;; (use-package exwm-firefox -;; :after exwm-firefox-core -;; :straight (exwm-firefox -;; :type git -;; :host github -;; :repo "ieure/exwm-firefox") -;; :config -;; (exwm-firefox-mode)) - -;; (use-package exwm-mff -;; :straight (exwm-mff -;; :host github -;; :repo "ieure/exwm-mff" -;; :fork ( -;; :host github -;; :repo "duckwork/exwm-mff")) -;; :after exwm -;; :hook -;; (exwm-init-hook . exwm-mff-mode)) - -;; (use-package exwm-edit) - -;; ) ;; end of *acdw/at-larry* block for exwm - ;;;; IRC (use-package circe - :if *acdw/at-larry* :init (defun my/fetch-password (&rest params) "Fetch a password from auth-sources" @@ -790,14 +719,14 @@ ;;;; org-mode (use-package org - :init - (setq org-startup-indented t) - (setq org-src-tab-acts-natively t) - (setq org-hide-emphasis-markers t) - (setq org-fontify-done-headline t) - (setq org-hide-leading-stars t) - (setq org-pretty-entities t) - + :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) + :config (font-lock-add-keywords 'org-mode '(("^ *\\([-+*]\\) " (0 (prog1 () (compose-region (match-beginning 1) @@ -808,13 +737,14 @@ (use-package org-bullets :hook - (org-mode-hook . (lambda () (org-bullets-mode)))) + (org-mode-hook . org-bullets-mode)) ;;;; SLIME -- for LISP (use-package slime - :init - (setq inferior-lisp-program (cond ((executable-find "sbcl") - (executable-find "sbcl"))))) + :custom + (inferior-lisp-program (cond ((executable-find "sbcl") + (executable-find "sbcl"))))) + (provide 'init) ;;; init.el ends here -- cgit 1.4.1-21-gabe81