.emacs-all 5.8 KB

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