;; Bootstrap Straight Package Manager (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) ;; packages to install and load (straight-use-package 'auto-complete) (straight-use-package '(nano-theme :type git :host github :repo "rougier/nano-theme")) (straight-use-package '(slime-company :type git :host github :repo "anwyn/slime-company")) (straight-use-package 'sublimity) (straight-use-package 'all-the-icons) (straight-use-package 'neotree) (straight-use-package 'rust-mode) (straight-use-package 'markdown-mode) (straight-use-package 'slime) (straight-use-package 'ac-slime) (straight-use-package 'evil) (straight-use-package 'dimmer) (straight-use-package 'magit) (straight-use-package 'diff-hl) (straight-use-package 'rainbow-delimiters) (straight-use-package 'focus) (straight-use-package 'solarized-theme) (straight-use-package 'windresize) (straight-use-package 'yasnippet) (straight-use-package '(janet-mode :type git :host github :repo "ALSchwalm/janet-mode")) (straight-use-package '(puppet-mode :type git :host github :repo "voxpupuli/puppet-mode")) (straight-use-package '(pico8-mode :type git :host github :repo "Kaali/pico8-mode")) (straight-use-package '(fzf :type git :host github :repo "bling/fzf.el")) ;; EasyPG settings (setq epa-pinentry-mode 'loopback) ;; newlisp mode (straight-use-package '(newlisp-mode :type git :host github :repo "may/newlisp-mode")) ;; Straight weirdly doesn't resolve this correctly (load-file "~/.emacs.d/straight/repos/newlisp-mode/newlisp.el") ;; Mastodon (straight-use-package '(mastodon :type git :host nil :repo "https://codeberg.org/martianh/mastodon.el")) ;; Gopher browser (straight-use-package 'elpher) (straight-use-package 'xterm-color) (defun display-ansi-colors () (interactive) (let ((inhibit-read-only t)) (ansi-color-apply-on-region (point-min) (point-max)))) ;;; Terminal in emacs via vterm lib (straight-use-package '(vterm :type git :host github :repo "akermu/emacs-libvterm")) ;;; Vterm config (setq vterm-buffer-name-string "%s") (add-hook 'vterm-mode-hook (lambda () (set (make-local-variable 'buffer-face-mode-face) 'fixed-pitch) (buffer-face-mode t))) (global-set-key (kbd "C-c ") 'vterm-send-escape) ; (global-set-key (kbd "C-c C-u") 'vterm-send-C-u) ; Readline line (global-set-key (kbd "C-c C-w") 'vterm-send-C-w) ; Readline word (global-set-key (kbd "C-c C-d") 'vterm-send-C-d) ; Exit (global-set-key (kbd "C-c C-r") 'vterm-send-C-r) ; Reverse search (global-set-key (kbd "C-b") 'vterm-send-C-b) ; Tmux (global-set-key (kbd "C-c C-a") 'vterm-send-C-a) ; Exit screen ;;; Syntax highlights for uxn-tal (straight-use-package '(tal-mode :type git :host github :repo "rafapaezbas/uxntal-mode")) ;; Haskell Mode (straight-use-package 'haskell-mode) ;;; Cursor highlighter (straight-use-package '(beacon :type git :host github :repo "Malabarba/beacon")) (beacon-mode) (global-set-key (kbd "C-c B") 'beacon-mode) ;; Racket config ;; (straight-use-package 'racket-mode) ;; Using DrRacket for now ;; Org to reveal.js presentations ;; Docs: https://github.com/yjwen/org-reveal#configuration (straight-use-package 'org-reveal) (require 'ox-reveal) (setq org-reveal-root "file:///home/swatson/Repos/reveal.js") ;; Vimperator like hints for ;; file navigationaki2o/emacs-pophint (straight-use-package '(pophint :type git :host github :repo "aki2o/emacs-pophint")) (global-set-key (kbd "C-c f") 'pophint:do-flexibly) ;;; Code folding (add-hook 'prog-mode-hook 'hs-minor-mode) (global-set-key (kbd "C-c a") 'hs-toggle-hiding) ;;; Error checking (global-set-key (kbd "C-c 2 e") 'flymake-mode) ;; System monitor ;; (straight-use-package ;; '(symon :type git :host github ;; :repo "zk-phi/symon")) ;; For whatever reason, using straight to build this ;; package results in bugs on Linux (not OSX). I'm assuming ;; because straight is building from git and there is a regression. ;; As such -- MELPA config ;; This config is likely redudant and I can use the straight ;; MELPA interface, but it's working and I'm too lazy to change it ;; 2022/03/03 - Using straight MEPLA interface also surfaces this bug. ;; Below seems to be only reliable cross platform way to include this package ;; (require 'package) ;; (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) ;; (package-install 'symon) ;; ;;(symon-mode 1) (straight-use-package '(telephone-line :type git :host github :repo "dbordak/telephone-line")) (telephone-line-mode 1) ;;; Indent highlighting (straight-use-package '(highlight-indent-guides :type git :host github :repo "DarthFennec/highlight-indent-guides")) (setq highlight-indent-guides-method 'character) (add-hook 'prog-mode-hook 'highlight-indent-guides-mode) ;; Org mode ;; Get src block tabs to work how I expect (setq org-src-tab-acts-natively t) (setq org-src-preserve-indentation nil org-edit-src-content-indentation 0) ;; tramp (setq tramp-default-method "ssh") ;; Ivy ;; (straight-use-package 'ivy) ;; (ivy-mode) ;; (setq ivy-use-virtual-buffers t) ;; (setq enable-recursive-minibuffers t) ;; (require 'ido) (ido-mode t) (require 'yasnippet) ;; Configure focus (require 'focus) (add-to-list 'focus-mode-to-thing '(lisp-mode . paragraph)) ;; rainbow delims (require 'rainbow-delimiters) (add-hook 'prog-mode-hook #'rainbow-delimiters-mode) ;; Git stuff (require 'magit) (require 'diff-hl) ;; Just enable diff-hl per buffer, ;; it seems expensive ;; (global-diff-hl-mode) (add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh) (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh) (diff-hl-margin-mode t) (require 'dimmer) (setq dimmer-fraction 0.4) (require 'evil) (evil-mode 1) ;; Enable tab behavior like vi (straight-use-package '(evil-tabs :type git :host github :repo "krisajenkins/evil-tabs")) (require 'evil-tabs) (global-evil-tabs-mode t) (require 'auto-complete) (global-auto-complete-mode t) ;; Common Lisp (require 'slime) (require 'ac-slime) (slime-setup '(slime-fancy ac-slime)) (add-hook 'slime-mode-hook 'set-up-slime-ac) (add-hook 'slime-repl-mode-hook 'set-up-slime-ac) (eval-after-load "auto-complete" '(add-to-list 'ac-modes 'slime-repl-mode)) ;; Guile (straight-use-package 'geiser) (straight-use-package 'geiser-guile) (setq geiser-active-implementations '(guile)) (require 'markdown-mode) (require 'neotree) (global-set-key (kbd "C-c n") 'neotree-toggle) (require 'all-the-icons) (require 'sublimity) (require 'sublimity-scroll) (require 'sublimity-map) ;; experimental (require 'sublimity-attractive) (setq sublimity-scroll-weight 10 sublimity-scroll-drift-length 5) (setq sublimity-map-size 40) (setq sublimity-map-fraction 0.3) (setq sublimity-map-text-scale -5) (sublimity-map-set-delay 0.1) (setq sublimity-attractive-centering-width nil) (setq backup-directory-alist `((".*" . ,temporary-file-directory))) (setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t))) ;;; Generic options for all OSs ;;; Smooth mouse scroll a bit ;;; If scrolling performance is bad, remember the profiler: ;;; https://christiantietze.de/posts/2020/12/emacs-scroll-performance-projectile/ (setq mouse-wheel-progressive-speed t) ;; whitespace config ;; make whitespace-mode use just basic coloring (setq whitespace-style '(face tabs)) (setq tab-face (make-face 'tab-face)) (set-face-background 'tab-face "gray") (setq whitespace-tab 'tab-face) (defun sol-dk () (interactive) (load-theme 'solarized-dark)) (defun sol-l () (interactive) (load-theme 'solarized-light)) ;; General is typically used for mode specific ;; rebinds and keymaps, while 'global-set-key ;; is still used for global keymaps for the sake of ;; clarity (straight-use-package 'general) ;; Keybinds/macros (global-set-key (kbd "C-c C-q") #'mu-magit-kill-buffers) (global-set-key (kbd "C-c ;") 'comment-line) (global-set-key (kbd "C-c b") 'fzf-switch-buffer) (global-set-key (kbd "C-c z") '(lambda () (interactive) (switch-to-buffer "*scratch*") (fzf-find-file))) (global-set-key (kbd "C-c e") '(lambda () (interactive) (diff-hl-mode) (diff-hl-flydiff-mode))) (global-set-key (kbd "C-c d") 'slime-describe-symbol) (global-set-key (kbd "C-c M-r") 'slime-restart-inferior-lisp) (global-set-key (kbd "C-c D") 'dimmer-mode) (global-set-key (kbd "C-c S") 'sublimity-mode) (global-set-key (kbd "C-c s") 'flyspell-correct-word-before-point) (global-set-key (kbd "C-c F") 'focus-mode) (global-set-key (kbd "C-c r") '(lambda () (interactive) (load-file (file-truename "~/.emacs")))) (global-set-key (kbd "C-c C-e") '(lambda () (interactive) (find-file (file-truename "~/.emacs")) (with-current-buffer (buffer-name) (emacs-lisp-mode)))) (global-set-key (kbd "C-c l") 'display-line-numbers-mode) (global-set-key (kbd "C-c w") 'window-swap-states) (global-set-key (kbd "C-c C-W") 'windresize) (global-set-key (kbd "C-c W") 'whitespace-mode) (global-set-key (kbd "C-c t") 'sol-dk) (global-set-key (kbd "C-c y") 'sol-l) (global-set-key (kbd "C-c g") 'magit) (global-set-key (kbd "C-c C-.") '(lambda () (interactive) (switch-to-buffer "*Messages*"))) (global-set-key (kbd "C-c C-f") 'find-file-at-point) (global-set-key (kbd "C-c m p") '(lambda () (interactive) (shell-command "mpc toggle"))) ;;; Erc config (setq erc-nick "speskk") (setq erc-hide-list '("JOIN" "PART" "QUIT")) (if (file-exists-p "~/.emacs.d/.erc-auth.el") (progn (load "~/.emacs.d/.erc-auth.el") (defun connect-to-libera-erc () (interactive) (erc :server "irc.libera.chat" :port "6667" :nick "speskk" :password *libera-chat*)))) ;; Allow M-up / M-down behavior to switch windows (windmove-default-keybindings 'meta) (display-time-mode t) ;; Perl Config (setq perl-indent-parens-as-block 0 perl-indent-level 8) ;; Set to make mouse focus window (setq mouse-autoselect-window t focus-follows-mouse t) ;; Custom eshell prompt (setq eshell-prompt-function (lambda nil " λ > ")) (setq eshell-prompt-regexp "^ λ > ") (set-language-environment "UTF-8") ;; Simple rclone cli wrapper (load "~/Repos/dotfiles/emacs/elisp/rclone.el") (global-set-key (kbd "C-c o") 'rclone-post-buffer) (global-set-key (kbd "C-c C-o") 'rclone-get-org) ;; Small helper functions (load "~/Repos/dotfiles/emacs/elisp/helpers.el") (global-set-key (kbd "C-c p") 'display-full-buffer-path) (global-set-key (kbd "C-c C-P") 'post-region-to-pb) (global-set-key (kbd "C-c 2 p") 'display-pb) ;; Disable bars ;; (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) ;; Start in server mode (server-start) ;; Load for macOS ;;; Slime/etc (if (eq system-type 'darwin) (progn ;; Configure yasnippet (setq yas-snippet-dirs '("~/Repos/dotfiles/emacs/yasnippets/")) (yas-global-mode 1) (setq inferior-lisp-program "/opt/homebrew/bin/sbcl") (load (expand-file-name "~/.local/opt/quicklisp/slime-helper.el")) ;; Font/themes/etc (load "/Users/swatson/Repos/dotfiles/emacs/mac-load/customs.el") ;; Easily set cua mode on/off so that I don't have to ;; use shift+insert for paste on mac (global-set-key (kbd "C-c c") 'cua-mode) ;; (global-set-key (kbd "C-c n") 'toggle-frame-fullscreen) ;; Graphic Display (if (display-graphic-p) (progn (load-theme 'solarized-dark t))))) ;; Load for GUI Linux (if (eq system-type 'gnu/linux) (if (display-graphic-p) (progn ;; normal home/end behavior in GUI (global-set-key (kbd "") 'beginning-of-line) (global-set-key (kbd "") 'end-of-line) (load (expand-file-name "~/quicklisp/slime-helper.el")) (setq inferior-lisp-program (locate-file "sbcl" exec-path exec-suffixes 1)) ;; https://emacs.stackexchange.com/questions/332/how-can-i-find-the-path-to-an-executable-with-emacs-lisp (setq yas-snippet-dirs '("~/Repos/dotfiles/emacs/yasnippets/")) (yas-global-mode 1) (if (file-exists-p "~/.enable_exwm") (progn (straight-use-package 'exwm) (require 'exwm) (load "~/Repos/dotfiles/emacs/linux-load/exwm-config.el") (require 'exwm-config-spw) (exwm-config-spw))) (setq visible-bell 1) (load "~/Repos/dotfiles/emacs/linux-load/customs.el") (load-theme 'solarized-light t)))) ;; Load for Term (unless (display-graphic-p) (progn (load "~/Repos/dotfiles/emacs/linux-load/customs.el") (xterm-mouse-mode t) (menu-bar-mode -1) (setq vc-follow-symlinks t) ;;; Typically in the full GUI I want to know it's a symlink (global-set-key (kbd "") 'beginning-of-line) (global-set-key (kbd "") 'end-of-line) (global-set-key (kbd "C-c c c") (lambda () (interactive) (shell-command-on-region (point) (mark) "xclip -selection clipboard"))) (load (expand-file-name "~/quicklisp/slime-helper.el")) (setq inferior-lisp-program (locate-file "sbcl" exec-path exec-suffixes 1)))) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(custom-safe-themes '("ab058aa22bdaf17b5d8a9e21632a62c8966728ae10ef8fd07e95637e9cdf7a7b" "f0eb51d80f73b247eb03ab216f94e9f86177863fb7e48b44aacaddbfe3357cf1" "4c56af497ddf0e30f65a7232a8ee21b3d62a8c332c6b268c81e9ea99b11da0d3" "fee7287586b17efbfda432f05539b58e86e059e78006ce9237b8732fde991b4c" "2809bcb77ad21312897b541134981282dc455ccd7c14d74cc333b6e549b824f3" "c433c87bd4b64b8ba9890e8ed64597ea0f8eb0396f4c9a9e01bd20a04d15d358" "0fffa9669425ff140ff2ae8568c7719705ef33b7a927a0ba7c5e2ffcfac09b75" "01106ca9b4446341ecb86a76b9db48f1100e2eb13980aa0ec6f6adf8e69fd9a7" default)) '(display-time-mode t) '(frame-background-mode 'dark)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(default ((t (:family "Envy Code R" :foundry "UNKN" :slant normal :weight normal :height 100 :width normal)))) '(org-level-1 ((t (:inherit variable-pitch :foreground "#cb4b16" :height 1.0)))) '(org-level-2 ((t (:inherit variable-pitch :foreground "#859900" :height 1.0)))) '(org-level-3 ((t (:inherit variable-pitch :foreground "#268bd2" :height 1.0)))) '(org-level-4 ((t (:inherit variable-pitch :foreground "#b58900" :height 1.0)))))