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

40
init.el
View File

@ -5,6 +5,9 @@
(require 'cl-lib)
;; (setq debug-on-error t)
;;; Utilitty functions.
(defun localize-path (path)
"If the path is relative, place it in the user's home directory."
(let ((home-dir (getenv "HOME")))
@ -27,6 +30,8 @@ present on disk."
(expand-file-name path
(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 ()
(member (system-name) '("GEIMACFHPL9CRFG9")))
@ -34,8 +39,11 @@ present on disk."
(require 'package)
(setq package-user-dir (cache-path "packages"))
(package-initialize)
;;; The work machine needs to go through a corporate proxy. Part of
;;; what makes it braindead.
(when (braindead-machine-p)
(customize-set-variables 'url-proxy-services
(setq url-proxy-services
'(("no_proxy" . "^\\(localhost\\|127\\..*\\)")
("http" . "127.0.0.1:9000")
("https" . "127.0.0.1:9000"))))
@ -61,6 +69,11 @@ present on disk."
(when (string= system-type "darwin")
(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
`(("." . ,(cache-path "backups"))))
@ -100,9 +113,9 @@ present on disk."
;; i like refilling paragraphs
(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)
(mapcar (lambda (path)
(add-to-list 'exec-path path))
(localize-and-filter
@ -110,28 +123,16 @@ present on disk."
"/usr/local/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)
(setq scpaste-http-destination "https://p.kyleisom.net"
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
(global-set-key (kbd "C-c C-d")
(lambda () (interactive) (insert "\u25ca")))
(add-to-list 'auto-mode-alist '("\\.poly.pm\\'" . text-mode))
(require 'markdown-mode)
(global-set-key (kbd "C-c b")
'compile)
@ -314,7 +315,8 @@ present on disk."
"ono-sendai" 13 ;; 12.5" X230
"orion" 16 ;; Intel NUC
"imladris" 18 ;; 14" X1 carbon
"hosaka" 18 ;; uConsole
"hosaka" 18 ;; uConsole (1280x720)
"GEIMACFHPL9CRFG9" 18 ;; work machine
)))
;;; font sizing bar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -345,9 +347,9 @@ present on disk."
;; I always end up running emacs from a GUI, easier to add a function
;; to disable this later.
(load-theme +DEFAULT-THEME+)
(set-frame-font (get-default-font))
(add-to-list 'default-frame-alist '(maximized . fullheight))
(reset-frame-font)
(unless (server-running-p)
(server-start))
(setq default-frame-alist `((font . ,(get-default-font))))
(setq default-frame-alist `((font . ,(get-default-font))
(maximized . fullheight)))