aboutsummaryrefslogtreecommitdiff
path: root/shoshimacs.el
diff options
context:
space:
mode:
authorshoshin <shoshin@cicadas.surf>2023-05-12 21:34:57 -0500
committershoshin <shoshin@cicadas.surf>2023-05-12 21:37:06 -0500
commit2c9aa551e5a56a775da69e4ecc19ea75b8bc4aee (patch)
tree89a53a00c4e7969c03952334bd1e1865e568c2a2 /shoshimacs.el
parent9da5adccc37190095d0cf5fb98554fbfdf529a42 (diff)
Clean: fix lint errors, warnings and notes
Diffstat (limited to 'shoshimacs.el')
-rw-r--r--shoshimacs.el88
1 files changed, 49 insertions, 39 deletions
diff --git a/shoshimacs.el b/shoshimacs.el
index fec63b2..b210f6e 100644
--- a/shoshimacs.el
+++ b/shoshimacs.el
@@ -1,4 +1,8 @@
-;;; shoshimacs.el --- Beginner's Mind Config -*- lexical-binding:t -*-
+;;; shoshimacs.el --- Beginner's Mind Config -*- lexical-binding:t -*-
+;;; Commentary:
+;;; Personal configuration rewritten from basics.
+
+;;; Code:
(let ((my-custom-file (expand-file-name
"shoshimacs-custom.el" user-emacs-directory)))
@@ -16,7 +20,7 @@
(find-file *my-config*))
(defun my-reload-config ()
- "Tangles and reloads a literate config with `org-babel-load-file'"
+ "Tangles and reloads a literate config with `org-babel-load-file'."
(interactive)
(org-babel-load-file *my-config*))
@@ -37,17 +41,23 @@
"List of themes I prefer for narrowing and random selection.")
;;; Package Management
+(require 'package)
+
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(package-refresh-contents) ;; this will make internet requests on start up
-(when (and (functionp #'native-comp-available-p) (native-comp-available-p))
- (setq native-comp-always-compile t
- package-native-compile t))
+(require 'comp)
+(setq native-comp-always-compile t
+ package-native-compile t)
;;; Major Keybinding
;; these need to be set before requiring the package
+(defvar xah-fly-use-control-key)
+(defvar xah-fly-use-meta-key)
+(defvar xah-fly-leader-key-map)
+(defvar xah-fly-command-map)
(setq xah-fly-use-control-key nil
xah-fly-use-meta-key nil)
(package-install 'xah-fly-keys)
@@ -58,18 +68,18 @@
(define-key 'xah-fly-leader-key-map (kbd "1") #'delete-other-windows)
(defmacro with-map-defkey (keymap leader &rest pairs)
- "Define a new KEYMAP with prefix key LEADER, and list of bindings in it."
+ "Define a new KEYMAP with prefix key LEADER and list of bindings PAIRS in it."
(declare (indent 2))
`(progn
(defvar ,keymap (make-sparse-keymap))
(define-prefix-command (quote ,keymap))
(global-set-key (kbd ,leader) ,keymap)
(mapc (lambda (pair)
- (define-key ,keymap
- (kbd (if (numberp (car pair)) (number-to-string (car pair))
- (symbol-name (car pair))))
- (cadr pair)))
- (quote ,(seq-partition pairs 2)))))
+ (define-key ,keymap
+ (kbd (if (numberp (car pair)) (number-to-string (car pair))
+ (symbol-name (car pair))))
+ (cadr pair)))
+ (quote ,(seq-partition pairs 2)))))
(with-map-defkey my-key-map "M-m"
1 delete-other-windows
@@ -99,6 +109,7 @@
tab-always-indent 'complete)
(package-install 'consult)
+(require 'consult)
(global-set-key (kbd "C-x b") #'consult-buffer)
(define-key xah-fly-leader-key-map (kbd "f") #'consult-buffer)
@@ -109,6 +120,7 @@
(setq consult-themes my-chosen-themes))
(defun my-show-all-themes ()
+ "Remove the selected themes from `consult-themes` so all installed themes will show."
(interactive)
(setq consult-themes nil))
@@ -171,6 +183,7 @@
org-refile-targets '((nil . (:maxlevel . 2))))
(defun my-org-top-level-heading ()
+ "Jump to the top level parent of an org subtree."
(interactive)
(let ((moo 1))
(while moo (setq moo (org-up-heading-safe)))))
@@ -202,9 +215,29 @@
;;; Programming
(setq inferior-lisp-program "sbcl")
-(package-install 'sly)
-
-(package-install 'sly-quicklisp)
+(setq slime-contribs
+ '(
+ slime-fancy ;; default value, includes many fundamental contribs
+ slime-company
+ slime-mrepl
+ inferior-slime
+ slime-fuzzy
+ slime-asdf
+ slime-banner
+ slime-presentations
+ slime-xref-browser
+ slime-highlight-edits
+ slime-quicklisp
+ ))
+
+(slime-setup)
+
+(defun my-slime-return (_)
+ "Function to advise `slime-repl-return' to make <RET> inspect the presentation at point."
+ (when (slime-presentation-around-or-before-point-p)
+ (slime-inspect-presentation-at-point (point))))
+
+(advice-add 'slime-repl-return :before #'my-slime-return)
(package-install 'json-mode)
@@ -253,31 +286,6 @@
(package-install 'srht)
(setq srht-username "shoshin")
-(defun read-file-into-string (f)
- (with-temp-buffer
- (insert-file-contents f)
- (buffer-string)))
-
-(setq cicadas-paste-pw (read-file-into-string "~/.bepasty-key"))
-
-(defun cicadas-paste-current-buffer ()
- (interactive)
- (let ((tmpfile
- (concat "/tmp/" (buffer-name))))
- (write-region nil nil tmpfile)
- (let ((url
- (cl-first (last (butlast
- (split-string
- (shell-command-to-string
- (format "pastebinit -i '%s' -p %s -t '%s' -f text/plain"
- tmpfile
- cicadas-paste-pw
- (buffer-name)))
- "\n"))))))
- (delete-file tmpfile)
- (kill-new url)
- (message "Pasted to %s (on kill ring)" url))))
-
(package-install 'restclient)
;;; User Interface
@@ -331,3 +339,5 @@ Saves to a temp file and puts the filename in the kill ring."
(message filename)))
(package-install 'windresize)
+(provide 'shoshimacs)
+;;; shoshimacs.el ends here