This commit is contained in:
Case Duckworth 2021-05-04 20:02:17 -05:00
commit 7372de3355
4 changed files with 73 additions and 48 deletions

View File

@ -85,7 +85,7 @@
(:home "DejaVu Sans")
(:work "Calibri")
(:other "sans-serif"))
acdw-fonts/variable-size 11)
acdw-fonts/variable-size 12)
(acdw-fonts/set)
(acdw-fonts/setup-emoji-fonts "Segoe UI Emoji"
"Noto Color Emoji"
@ -95,7 +95,7 @@
(acdw/setup-fringes)
;; only run this once
(remove-function after-focus-change-function
'hook--setup-fonts)))
'acdw/first-frame-setup)))
;;; Bootstrap package manager (`straight.el')

View File

@ -45,6 +45,15 @@
gnus-use-cache t
gnus-read-active-file 'some)
;; Keybindings
(define-key gnus-group-mode-map (kbd "q")
(defun gnus-cloud-upload-and-bury-buffer ()
(interactive)
(gnus-cloud-upload-all-data)
(bury-buffer)))
(define-key gnus-group-mode-map (kbd "Q") #'gnus-group-exit)
(define-key gnus-group-mode-map (kbd "C-q") #'gnus-group-quit)
;;; Other parameters
(setq gnus-parameters
'(("nnimap\\.*"

99
init.el
View File

@ -53,9 +53,6 @@
no-littering-var-directory (acdw/dir))
(require 'no-littering))
;;;; `idle-require'
(setup (:straight idle-require))
;;;; My packages
(when-let ((default-directory
(expand-file-name-exists-p "pkg/" user-emacs-directory)))
@ -266,8 +263,6 @@
(:option eshell-directory-name (acdw/dir "eshell/" t)
eshell-aliases-file (acdw/dir "eshell/aliases" t))
(idle-require 'eshell)
(defun eshell-quit-or-delete-char (arg)
"Delete the character to the right, or quit eshell on an empty line."
(interactive "p")
@ -346,8 +341,6 @@
(when (not (file-exists-p gnus-directory))
(make-directory gnus-directory :parents))
(idle-require 'gnus)
(:leader "m" gnus))
(setup imenu
@ -563,7 +556,9 @@
w32-pass-apps-to-system nil
w32-apps-modifier 'hyper))
;; "Et cetera" settings
;;; "Et cetera" settings
;; This should stay as /minimal/ as possible. Anything that can go somewhere
;; else /should/ go there.
(setup emacs
(:option disabled-command-function nil
load-prefer-newer t
@ -573,8 +568,12 @@
attempt-orderly-shutdown-on-fatal-signal nil
find-function-C-source-directory (acdw/find-emacs-source))
(:global "M-=" count-words)
(:global "M-=" count-words
"C-w" acdw/kill-region-or-backward-word)
;; Remap C-h to DEL -- <f1> can be the "help" key
(define-key key-translation-map [?\C-h] [?\C-?])
(:leader "C-c" save-buffers-kill-emacs
"t" acdw/insert-iso-date))
@ -613,10 +612,52 @@
(eval-after-load "isearch"
'(define-key isearch-mode-map (kbd "C-'") #'avy-isearch)))
(setup (:straight (beginend
:fork (:repo "duckwork/beginend")))
(setup (:straight (beginend))
(beginend-global-mode +1))
(setup common-lisp-ide
(defvar acdw/cl-ide :sly)
(defvar acdw/lisp-bin (or (executable-find "sbcl")
(executable-find "clisp")))
(:needs acdw/lisp-bin)
(:option inferior-lisp-program acdw/lisp-bin)
(setup (:straight clhs))
(pcase acdw/cl-ide
(:slime
(setup (:straight slime)
(:also-load slime-autoloads)
(when-let ((slime-helper (or (expand-file-name-exists-p
"~/quicklisp/slime-helper.el")
(expand-file-name-exists-p
"~/var/quicklisp/slime-helper.el"))))
(load slime-helper))
(define-key slime-repl-mode-map (kbd "RET") #'slime-repl-return-at-end)
(define-key slime-repl-mode-map (kbd "<return>")
#'slime-repl-return-at-end)
(defun slime-repl-return-at-end ()
(interactive)
(if (<= (point-max) (point))
(slime-repl-return)
(slime-repl-newline-and-indent)))
(with-eval-after-load 'company
(setup (:straight slime-company)
(:option slime-company-completion 'fuzzy
slime-company-after-completion nil)
(slime-setup '(slime-fancy slime-company))))))
(:sly
(setup (:straight sly)
(:option sly-kill-without-query-p t)
(:also-load sly-autoloads)))))
(setup (:straight (consult
:host github
:repo "minad/consult"))
@ -749,9 +790,7 @@ if ripgrep is installed, otherwise `consult-grep'."
(require 'gemini-write))))
(setup (:straight expand-region)
(:global "C-=" er/expand-region)
(idle-require 'expand-region))
(:global "C-=" er/expand-region))
(setup (:straight fennel-mode)
(:needs "fennel")
@ -763,36 +802,6 @@ if ripgrep is installed, otherwise `consult-grep'."
(setup (:straight geiser))
(setup common-lisp-ide
(defvar acdw/cl-ide :sly)
(defvar acdw/lisp-bin (or (executable-find "sbcl")
(executable-find "clisp")))
(:needs acdw/lisp-bin)
(:option inferior-lisp-program acdw/lisp-bin)
(pcase acdw/cl-ide
(:slime
(setup (:straight slime)
(:also-load slime-autoloads)
(when-let ((slime-helper (or (expand-file-name-exists-p
"~/quicklisp/slime-helper.el")
(expand-file-name-exists-p
"~/var/quicklisp/slime-helper.el"))))
(load slime-helper))
(with-eval-after-load 'company
(setup (:straight slime-company)
(:option slime-company-completion 'fuzzy
slime-company-after-completion nil)
(slime-setup '(slime-fancy slime-company))))))
(:sly
(setup (:straight sly)
(:option sly-kill-without-query-p t)
(:also-load sly-autoloads)))))
(setup (:straight (gemini-mode
:host nil
:repo "https://git.carcosa.net/jmcbray/gemini.el.git"))
@ -901,8 +910,6 @@ if ripgrep is installed, otherwise `consult-grep'."
org-tags-column (- 0 fill-column -3)
org-directory "~/org")
(idle-require 'org)
(:bind "RET" acdw-org/return-dwim
"<S-return>" acdw-org/org-table-copy-down)

View File

@ -29,6 +29,8 @@
;;; Utility functions
;; I don't prefix these because ... reasons. Honestly I probably should prefix
;; them.
(defun dos2unix (buffer)
"Replace \r\n with \n in BUFFER."
@ -58,6 +60,13 @@ each hook in HOOKS."
,@(dolist (hook hook-list hook-defun-add-hook-list)
(push `(add-hook ',hook #',func-name) hook-defun-add-hook-list)))))
(defun kill-region-or-backward-word (arg)
"Kill region if active, or backward word if not."
(interactive "p")
(if (region-active-p)
(kill-region (region-beginning) (region-end))
(backward-kill-word arg)))
(defmacro when-unfocused (name &rest forms)
"Define a function NAME, executing FORMS, that fires when Emacs
is unfocused."