This commit is contained in:
Kyle Isom 2025-05-06 14:58:57 -07:00
parent 0d9779af5e
commit f85eef153e
1 changed files with 28 additions and 26 deletions

54
init.el
View File

@ -5,6 +5,9 @@
(require 'cl-lib) (require 'cl-lib)
;; (setq debug-on-error t) ;; (setq debug-on-error t)
;;; Utilitty functions.
(defun localize-path (path) (defun localize-path (path)
"If the path is relative, place it in the user's home directory." "If the path is relative, place it in the user's home directory."
(let ((home-dir (getenv "HOME"))) (let ((home-dir (getenv "HOME")))
@ -27,6 +30,8 @@ present on disk."
(expand-file-name path (expand-file-name path
(expand-file-name "cache" user-emacs-directory))) (expand-file-name "cache" user-emacs-directory)))
;;; My work machine is braindead --- locked down to be of much use,
;;; and can't have the org-mode setup.
(defun braindead-machine-p () (defun braindead-machine-p ()
(member (system-name) '("GEIMACFHPL9CRFG9"))) (member (system-name) '("GEIMACFHPL9CRFG9")))
@ -34,11 +39,14 @@ present on disk."
(require 'package) (require 'package)
(setq package-user-dir (cache-path "packages")) (setq package-user-dir (cache-path "packages"))
(package-initialize) (package-initialize)
;;; The work machine needs to go through a corporate proxy. Part of
;;; what makes it braindead.
(when (braindead-machine-p) (when (braindead-machine-p)
(customize-set-variables 'url-proxy-services (setq url-proxy-services
'(("no_proxy" . "^\\(localhost\\|127\\..*\\)") '(("no_proxy" . "^\\(localhost\\|127\\..*\\)")
("http" . "127.0.0.1:9000") ("http" . "127.0.0.1:9000")
("https" . "127.0.0.1:9000")))) ("https" . "127.0.0.1:9000"))))
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
(add-to-list 'package-archives (add-to-list 'package-archives
@ -61,6 +69,11 @@ present on disk."
(when (string= system-type "darwin") (when (string= system-type "darwin")
(setq dired-use-ls-dired nil)) (setq dired-use-ls-dired nil))
;;; i like cua-rectangle
(cua-mode t)
(cua-selection-mode 'emacs)
(global-set-key (kbd "M-RET") 'cua-rectangle-mark-mode)
(setq backup-directory-alist (setq backup-directory-alist
`(("." . ,(cache-path "backups")))) `(("." . ,(cache-path "backups"))))
@ -100,9 +113,9 @@ present on disk."
;; i like refilling paragraphs ;; i like refilling paragraphs
(global-set-key (kbd "M-q") 'fill-paragraph) (global-set-key (kbd "M-q") 'fill-paragraph)
;; i install things to /usr/local ;;; add some of the local install paths to the exec path if they
;;; exist.
(require 'exec-path-from-shell) (require 'exec-path-from-shell)
(mapcar (lambda (path) (mapcar (lambda (path)
(add-to-list 'exec-path path)) (add-to-list 'exec-path path))
(localize-and-filter (localize-and-filter
@ -110,28 +123,16 @@ present on disk."
"/usr/local/bin" "/usr/local/bin"
"/opt/homebrew/bin"))) "/opt/homebrew/bin")))
;; tell me where i'm at
(column-number-mode)
;;; i like cua-rectangle
(cua-mode t)
(cua-selection-mode 'emacs)
(global-set-key (kbd "M-RET") 'cua-rectangle-mark-mode)
(require 'scpaste) (require 'scpaste)
(setq scpaste-http-destination "https://p.kyleisom.net" (setq scpaste-http-destination "https://p.kyleisom.net"
scpaste-scp-destination "p.kyleisom.net:/var/www/sites/p/") scpaste-scp-destination "p.kyleisom.net:/var/www/sites/p/")
;;; useful for writing
(global-set-key (kbd "C-x w") 'count-words)
;;; used with pollen ;;; used with pollen
(global-set-key (kbd "C-c C-d") (global-set-key (kbd "C-c C-d")
(lambda () (interactive) (insert "\u25ca"))) (lambda () (interactive) (insert "\u25ca")))
(add-to-list 'auto-mode-alist '("\\.poly.pm\\'" . text-mode)) (add-to-list 'auto-mode-alist '("\\.poly.pm\\'" . text-mode))
(require 'markdown-mode) (require 'markdown-mode)
(global-set-key (kbd "C-c b") (global-set-key (kbd "C-c b")
'compile) 'compile)
@ -310,11 +311,12 @@ present on disk."
size 8 size 8
test equal test equal
data ( data (
"titan.local" 16 ;; 16" MBP "titan.local" 16 ;; 16" MBP
"ono-sendai" 13 ;; 12.5" X230 "ono-sendai" 13 ;; 12.5" X230
"orion" 16 ;; Intel NUC "orion" 16 ;; Intel NUC
"imladris" 18 ;; 14" X1 carbon "imladris" 18 ;; 14" X1 carbon
"hosaka" 18 ;; uConsole "hosaka" 18 ;; uConsole (1280x720)
"GEIMACFHPL9CRFG9" 18 ;; work machine
))) )))
;;; font sizing bar ;;; font sizing bar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -345,9 +347,9 @@ present on disk."
;; I always end up running emacs from a GUI, easier to add a function ;; I always end up running emacs from a GUI, easier to add a function
;; to disable this later. ;; to disable this later.
(load-theme +DEFAULT-THEME+) (load-theme +DEFAULT-THEME+)
(set-frame-font (get-default-font)) (reset-frame-font)
(add-to-list 'default-frame-alist '(maximized . fullheight))
(unless (server-running-p) (unless (server-running-p)
(server-start)) (server-start))
(setq default-frame-alist `((font . ,(get-default-font)))) (setq default-frame-alist `((font . ,(get-default-font))
(maximized . fullheight)))