.emacs-all 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. ;;; Packages
  2. ;; Bootstrap Straight Package Manager
  3. (defvar bootstrap-version)
  4. (let ((bootstrap-file
  5. (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
  6. (bootstrap-version 5))
  7. (unless (file-exists-p bootstrap-file)
  8. (with-current-buffer
  9. (url-retrieve-synchronously
  10. "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
  11. 'silent 'inhibit-cookies)
  12. (goto-char (point-max))
  13. (eval-print-last-sexp)))
  14. (load bootstrap-file nil 'nomessage))
  15. ;; packages to install and load
  16. (straight-use-package 'auto-complete)
  17. (straight-use-package '(nano-theme :type git :host github
  18. :repo "rougier/nano-theme"))
  19. (straight-use-package
  20. '(slime-company :type git :host github :repo "anwyn/slime-company"))
  21. (straight-use-package 'sublimity)
  22. (straight-use-package 'dashboard)
  23. (straight-use-package 'all-the-icons)
  24. (straight-use-package 'neotree)
  25. (straight-use-package 'rust-mode)
  26. (straight-use-package 'powerline)
  27. (straight-use-package 'markdown-mode)
  28. (straight-use-package 'moe-theme)
  29. (straight-use-package 'ample-theme)
  30. (straight-use-package 'slime)
  31. (straight-use-package 'ac-slime)
  32. (straight-use-package 'evil)
  33. (straight-use-package 'dimmer)
  34. (straight-use-package 'magit)
  35. (straight-use-package 'diff-hl)
  36. (straight-use-package 'powerline-evil)
  37. (straight-use-package 'rainbow-delimiters)
  38. (straight-use-package 'focus)
  39. (straight-use-package 'solarized-theme)
  40. (straight-use-package 'windresize)
  41. ;; Configure focus
  42. (require 'focus)
  43. (add-to-list 'focus-mode-to-thing '(lisp-mode . paragraph))
  44. ;; rainbow delims
  45. (require 'rainbow-delimiters)
  46. (add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
  47. ;; Git stuff
  48. (require 'magit)
  49. (require 'diff-hl)
  50. ;; Just enable diff-hl per buffer,
  51. ;; it seems expensive
  52. ;; (global-diff-hl-mode)
  53. (add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh)
  54. (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)
  55. (diff-hl-margin-mode t)
  56. (require 'dimmer)
  57. (setq dimmer-fraction 0.4)
  58. ;; always enable ido mode
  59. (require 'ido)
  60. (ido-mode t)
  61. (require 'evil)
  62. (evil-mode 1)
  63. ;; Enable tab behavior like vi
  64. (straight-use-package '(evil-tabs :type git :host github
  65. :repo "krisajenkins/evil-tabs"))
  66. (require 'evil-tabs)
  67. (global-evil-tabs-mode t)
  68. (require 'auto-complete)
  69. (global-auto-complete-mode t)
  70. (require 'slime)
  71. (require 'ac-slime)
  72. (slime-setup '(slime-fancy ac-slime))
  73. (add-hook 'slime-mode-hook 'set-up-slime-ac)
  74. (add-hook 'slime-repl-mode-hook 'set-up-slime-ac)
  75. (eval-after-load "auto-complete"
  76. '(add-to-list 'ac-modes 'slime-repl-mode))
  77. (require 'markdown-mode)
  78. (require 'powerline)
  79. (powerline-default-theme)
  80. ;; Better powerline support for evil mode
  81. (require 'powerline-evil)
  82. (require 'neotree)
  83. (global-set-key [f8] 'neotree-toggle)
  84. (require 'dashboard)
  85. (dashboard-setup-startup-hook)
  86. (require 'all-the-icons)
  87. (require 'sublimity)
  88. (require 'sublimity-scroll)
  89. (require 'sublimity-map) ;; experimental
  90. (require 'sublimity-attractive)
  91. (setq sublimity-scroll-weight 10
  92. sublimity-scroll-drift-length 5)
  93. (setq sublimity-map-size 30)
  94. (setq sublimity-map-fraction 0.3)
  95. (setq sublimity-map-text-scale -9)
  96. (sublimity-map-set-delay 0.1)
  97. (setq sublimity-attractive-centering-width nil)
  98. (setq backup-directory-alist
  99. `((".*" . ,temporary-file-directory)))
  100. (setq auto-save-file-name-transforms
  101. `((".*" ,temporary-file-directory t)))
  102. ;;; Generic options for all OSs
  103. ; Smooth mouse scroll a bit
  104. (setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((control) . nil)))
  105. (setq mouse-wheel-progressive-speed nil)
  106. ;; normal home/end behavior
  107. (global-set-key (kbd "<home>") 'beginning-of-line)
  108. (global-set-key (kbd "<end>") 'end-of-line)
  109. ;; Custom functions
  110. (defun reload-dot-emacs ()
  111. (interactive)
  112. (load-file (file-truename "~/.emacs")))
  113. ;; Keybinds/macros
  114. (global-set-key (kbd "C-c e") 'diff-hl-mode)
  115. (global-set-key (kbd "C-c d") 'dimmer-mode)
  116. (global-set-key (kbd "C-c s") 'sublimity-mode)
  117. (global-set-key (kbd "C-c f") 'focus-mode)
  118. (global-set-key (kbd "C-c r") 'reload-dot-emacs)
  119. (global-set-key (kbd "C-c l") 'display-line-numbers-mode)
  120. (global-set-key (kbd "C-c w") 'windresize)
  121. (fset 'date-to-point
  122. (kmacro-lambda-form [?\C-u ?\M-! ?d ?a ?t ?e return] 0 "%d"))
  123. ;;; Erc config
  124. (setq erc-nick "speskk")
  125. ;; Allow M-up / M-down behavior to switch windows
  126. (windmove-default-keybindings 'meta)
  127. (display-time-mode t)
  128. ;; Perl Config
  129. (setq
  130. perl-indent-parens-as-block 0
  131. perl-indent-level 8)
  132. ;; Load for macOS
  133. ;;; Slime/etc
  134. (if (eq system-type 'darwin)
  135. (progn
  136. (setq inferior-lisp-program "/opt/homebrew/bin/sbcl")
  137. (load (expand-file-name "~/.local/opt/quicklisp/slime-helper.el"))
  138. (load "/Users/swatson/.emacs.d/.erc-auth.el")
  139. ;; Font/themes/etc
  140. (load "/Users/swatson/Repos/dotfiles/emacs/mac-load/customs.el")
  141. ;; Custom Commands
  142. (defun connect-to-libera-erc () (interactive)
  143. (erc :server "irc.libera.chat" :port "6667"
  144. :nick "speskk" :password *libera-chat*))
  145. ;; Easily set cua mode on/off so that I don't have to
  146. ;; use shift+insert for paste on mac
  147. (global-set-key (kbd "C-c c") 'cua-mode)
  148. ;; Graphic Display
  149. (if (display-graphic-p)
  150. (progn
  151. (load-theme 'solarized-dark t)))))
  152. ;; Load for Windows10
  153. (if (eq system-type 'windows-nt)
  154. (progn
  155. (load "C:/Users/watsonsi/Documents/GitHub/dotfiles/emacs/windows-load/customs.el")
  156. (setq visible-bell 1)
  157. (load-theme 'solarized-light t)))
  158. ;; Load for GUI Linux
  159. (if (eq system-type 'gnu/linux)
  160. (if (display-graphic-p)
  161. (progn
  162. (straight-use-package 'exwm)
  163. (require 'exwm)
  164. ;(require 'exwm-systemtray)
  165. ;(exwm-systemtray-enable)
  166. (load "~/Repos/dotfiles/emacs/linux-load/exwm-config.el")
  167. (require 'exwm-config-spw)
  168. (exwm-config-spw)
  169. (setq visible-bell 1)
  170. (load "~/Repos/dotfiles/emacs/linux-load/customs.el")
  171. (load-theme 'solarized-light t))))
  172. ;; Load for Term
  173. (unless (display-graphic-p)
  174. (xterm-mouse-mode t))