Advertisement
Guest User

init.el

a guest
Jun 29th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 4.00 KB | None | 0 0
  1. ;;; init.el --- My configuration -*- lexical-binding: t; -*-
  2.  
  3. ;;; Commentary:
  4. ;;
  5. ;; We're going the distance.
  6. ;; We're going for speed.
  7.  
  8. ;;; Code:
  9.  
  10. (defvar my-gc-cons-threshold 16777216 ;; 16Mb
  11.   "Not really mine. Just took it from Doom Emacs.
  12. The default value to use for `gc-cons-threshold'. If you experience freezing,
  13. decrease this. If you experience stuttering, increase this.")
  14.  
  15. (defvar my-gc-cons-upperlimit 536870912 ;; 512Mb
  16.   "Again, not really mine. Just from Doom Emacs.
  17. The temporary value for `gc-cons-threshold' to defer it.")
  18.  
  19. (defun restore-startup-optimizations ()
  20.   "Resets garbage collection settings to reasonable defaults (a large
  21. `gc-cons-threshold' can cause random freezes otherwise) and resets
  22. `file-name-handler-alist'."
  23.   (setq file-name-handler-alist file-name-handler-alist)
  24.   (run-with-idle-timer
  25.    3 nil
  26.    (lambda ()
  27.      (setq-default gc-cons-threshold my-gc-cons-threshold)
  28.      (defun my-defer-gc ()
  29.        (setq gc-cons-threshold my-gc-cons-upperlimit))
  30.      (defun my-restore-gc ()
  31.        (run-at-time 1 nil (lambda () (setq gc-cons-threshold my-gc-cons-threshold))))))
  32.   (add-hook 'minibuffer-setup-hook #'my-defer-gc)
  33.   (add-hook 'minibuffer-exit-hook #'my-restore-gc)
  34.   (if (boundp 'after-focus-change-function)
  35.                 (add-function :after after-focus-change-function
  36.                               (lambda ()
  37.                                 (unless (frame-focus-state)
  38.                                   (garbage-collect))))
  39.           (add-hook 'focus-out-hook 'garbage-collect)))
  40.  
  41. (if (ignore-errors (or after-init-time noninteractive))
  42.     (setq gc-cons-threshold my-gc-cons-threshold)
  43.   (setq gc-cons-threshold my-gc-cons-upperlimit)
  44.   (setq file-name-handler-alist nil)
  45.   (add-hook 'after-init-hook #'restore-startup-optimizations))
  46.  
  47. (setq load-prefer-newer noninteractive)
  48.  
  49. ;; Security things
  50.  
  51. (add-hook 'after-init-hook
  52.           (lambda ()
  53.             "Making things a bit more secure."
  54.             (setq tls-checktrust t
  55.                   gnutls-verify-error t
  56.                   network-security-level 'high
  57.                   gnutls-min-prime-bits 2048
  58.                   nsm-save-host-names t)))
  59.  
  60. ;; load freaking other Elisp files, fucker
  61. (add-to-list 'load-path "~/.emacs.d/lisp/")
  62. (add-to-list 'load-path "~/.emacs.d/site-lisp/")
  63.  
  64. ;; Require our thingies
  65.  
  66. ;; custom things
  67. (require 'init-custom)
  68.  
  69. ;; package things
  70. (require 'init-package)
  71.  
  72. ;; useful funcs and macros
  73. (require 'init-macros)
  74.  
  75. ;; Default
  76. (require 'init-defaults)
  77.  
  78. ;; Basics
  79. (require 'init-basics)
  80.  
  81. ;; Utilities
  82. (require 'init-utils)
  83.  
  84. ;; UI things
  85. (require 'init-ui)
  86.  
  87. ;; Dashboard
  88. (if minotaur-dashboard
  89.     (require 'init-dashboard))
  90.  
  91. ;; Editing things
  92. (require 'init-editing)
  93.  
  94. ;; Dired
  95. (require 'init-dired)
  96.  
  97. ;; Projectile
  98. (require 'init-projectile)
  99.  
  100. ;; Eshell
  101. (require 'init-eshell)
  102.  
  103. ;; Term
  104. (require 'init-term)
  105.  
  106. ;; Ido w/ Icomplete
  107. ;;(require 'init-ido)
  108.  
  109. ;; Ivy
  110. (require 'init-ivy)
  111.  
  112. ;; Helm
  113. ;;(require 'init-helm)
  114.  
  115. ;; iBuffer
  116. (require 'init-ibuffer)
  117.  
  118. ;; Company
  119. (require 'init-company)
  120.  
  121. ;; Window things
  122. (require 'init-windows)
  123.  
  124. ;; Persp
  125. (require 'init-persp)
  126.  
  127. ;; Org Mode
  128. (require 'init-org)
  129.  
  130. ;; SES things
  131. (require 'init-spreadsheets)
  132.  
  133. ;; Flycheck
  134. (require 'init-flycheck)
  135.  
  136. ;; Snippets
  137. (require 'init-yasnippet)
  138.  
  139. ;; LSP
  140. (require 'init-lsp)
  141.  
  142. ;; Emacs Lisp
  143. (require 'init-emacs-lisp)
  144.  
  145. ;; Assembly
  146. (require 'init-assembly)
  147.  
  148. ;; C/C++/Objective-C
  149. (require 'init-cc)
  150.  
  151. ;; Common Lisp
  152. (require 'init-common-lisp)
  153.  
  154. ;; Dlang
  155. (require 'init-d)
  156.  
  157. ;; .NET
  158. (require 'init-dotnet)
  159.  
  160. ;; Elixir
  161. (require 'init-elixir)
  162.  
  163. ;; Erlang
  164. (require 'init-erlang)
  165.  
  166. ;; Janet
  167. (require 'init-janet)
  168.  
  169. ;; Java
  170. (require 'init-java)
  171.  
  172. ;; Lua
  173. (require 'init-lua)
  174.  
  175. ;; Markdown
  176. (require 'init-markdown)
  177.  
  178. ;; Nim
  179. (require 'init-nim)
  180.  
  181. ;; Perl
  182. (require 'init-perl)
  183.  
  184. ;; Ruby
  185. (require 'init-ruby)
  186.  
  187. ;; Rust
  188. (require 'init-rust)
  189.  
  190. ;; Shell
  191. (require 'init-sh)
  192.  
  193. ;; Web stuff
  194. (require 'init-web)
  195.  
  196. ;; Key things
  197. (require 'init-keybindings)
  198.  
  199. ;;; init.el ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement