123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- ;;; PACKAGES
- ;; 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 'powerline)
- (straight-use-package 'markdown-mode)
- (straight-use-package 'moe-theme)
- (straight-use-package 'ample-theme)
- (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 'powerline-evil)
- (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"))
- ;; 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))))
- (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)))
- (straight-use-package
- '(tal-mode :type git :host github
- :repo "rafapaezbas/uxntal-mode"))
- ;;(straight-use-package
- ;; '(org :type git :repo "https://git.savannah.gnu.org/git/emacs/org-mode.git"))
- ;;(require 'org)
- (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)
- ;; always enable ido mode
- (require 'ido)
- (ido-mode t)
- (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)
- (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))
- (require 'markdown-mode)
- (require 'powerline)
- ;;(powerline-default-theme)
- ;; Better powerline support for evil mode
- (require 'powerline-evil)
- (powerline-evil-vim-color-theme)
- (require 'neotree)
- (global-set-key [f8] '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
- (setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((control) . nil)))
- (setq mouse-wheel-progressive-speed nil)
- ;; normal home/end behavior
- (global-set-key (kbd "<home>") 'beginning-of-line)
- (global-set-key (kbd "<end>") 'end-of-line)
- ;; Custom functions
- (defun reload-dot-emacs ()
- (interactive)
- (load-file (file-truename "~/.emacs")))
- (defun sol-dk ()
- (interactive)
- (load-theme 'solarized-dark))
- (defun sol-l ()
- (interactive)
- (load-theme 'solarized-light))
- ;; Keybinds/macros
- (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") 'fzf-find-file)
- (global-set-key (kbd "C-c e") 'diff-hl-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 f") 'focus-mode)
- (global-set-key (kbd "C-c r") 'reload-dot-emacs)
- (global-set-key (kbd "C-c l") 'display-line-numbers-mode)
- (global-set-key (kbd "C-c w") 'windresize)
- (global-set-key (kbd "C-c t") 'sol-dk)
- (global-set-key (kbd "C-c y") 'sol-l) ; Quick toggle evil-mode for slime err
- (global-set-key (kbd "C-c g") 'magit)
- (global-set-key (kbd "C-c h") 'tramp-cleanup-connection)
- (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)
- ;;; Can probably be replaced with
- ;;; a yasnippet
- (fset 'date-to-point
- (kmacro-lambda-form [?\C-u ?\M-! ?d ?a ?t ?e return] 0 "%d"))
- ;;; 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)
- ;; Disable bars
- (menu-bar-mode -1)
- (tool-bar-mode -1)
- (scroll-bar-mode -1)
- ;; 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 Windows10
- (if (eq system-type 'windows-nt)
- (progn
- ;; Configure yasnippet
- (setq yas-snippet-dirs
- '("C:/Users/watsonsi/Documents/Github/dotfiles/emacs/yasnippets/"))
- (yas-global-mode 1)
- (load "C:/Users/watsonsi/Documents/GitHub/dotfiles/emacs/windows-load/customs.el")
- (setq visible-bell 1)
- (load-theme 'solarized-light t)))
- ;; Load for GUI Linux
- (if (eq system-type 'gnu/linux)
- (if (display-graphic-p)
- (progn
- (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)
- (load (expand-file-name "~/quicklisp/slime-helper.el"))
- (setq inferior-lisp-program (locate-file "sbcl" exec-path exec-suffixes 1))))
|