Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;; init.el --- My configuration -*- lexical-binding: t; -*-
- ;;; Commentary:
- ;;
- ;; We're going the distance.
- ;; We're going for speed.
- ;;; Code:
- (defvar my-gc-cons-threshold 16777216 ;; 16Mb
- "Not really mine. Just took it from Doom Emacs.
- The default value to use for `gc-cons-threshold'. If you experience freezing,
- decrease this. If you experience stuttering, increase this.")
- (defvar my-gc-cons-upperlimit 536870912 ;; 512Mb
- "Again, not really mine. Just from Doom Emacs.
- The temporary value for `gc-cons-threshold' to defer it.")
- (defun restore-startup-optimizations ()
- "Resets garbage collection settings to reasonable defaults (a large
- `gc-cons-threshold' can cause random freezes otherwise) and resets
- `file-name-handler-alist'."
- (setq file-name-handler-alist file-name-handler-alist)
- (run-with-idle-timer
- 3 nil
- (lambda ()
- (setq-default gc-cons-threshold my-gc-cons-threshold)
- (defun my-defer-gc ()
- (setq gc-cons-threshold my-gc-cons-upperlimit))
- (defun my-restore-gc ()
- (run-at-time 1 nil (lambda () (setq gc-cons-threshold my-gc-cons-threshold))))))
- (add-hook 'minibuffer-setup-hook #'my-defer-gc)
- (add-hook 'minibuffer-exit-hook #'my-restore-gc)
- (if (boundp 'after-focus-change-function)
- (add-function :after after-focus-change-function
- (lambda ()
- (unless (frame-focus-state)
- (garbage-collect))))
- (add-hook 'focus-out-hook 'garbage-collect)))
- (if (ignore-errors (or after-init-time noninteractive))
- (setq gc-cons-threshold my-gc-cons-threshold)
- (setq gc-cons-threshold my-gc-cons-upperlimit)
- (setq file-name-handler-alist nil)
- (add-hook 'after-init-hook #'restore-startup-optimizations))
- (setq load-prefer-newer noninteractive)
- ;; Security things
- (add-hook 'after-init-hook
- (lambda ()
- "Making things a bit more secure."
- (setq tls-checktrust t
- gnutls-verify-error t
- network-security-level 'high
- gnutls-min-prime-bits 2048
- nsm-save-host-names t)))
- ;; load freaking other Elisp files, fucker
- (add-to-list 'load-path "~/.emacs.d/lisp/")
- (add-to-list 'load-path "~/.emacs.d/site-lisp/")
- ;; Require our thingies
- ;; custom things
- (require 'init-custom)
- ;; package things
- (require 'init-package)
- ;; useful funcs and macros
- (require 'init-macros)
- ;; Default
- (require 'init-defaults)
- ;; Basics
- (require 'init-basics)
- ;; Utilities
- (require 'init-utils)
- ;; UI things
- (require 'init-ui)
- ;; Dashboard
- (if minotaur-dashboard
- (require 'init-dashboard))
- ;; Editing things
- (require 'init-editing)
- ;; Dired
- (require 'init-dired)
- ;; Projectile
- (require 'init-projectile)
- ;; Eshell
- (require 'init-eshell)
- ;; Term
- (require 'init-term)
- ;; Ido w/ Icomplete
- ;;(require 'init-ido)
- ;; Ivy
- (require 'init-ivy)
- ;; Helm
- ;;(require 'init-helm)
- ;; iBuffer
- (require 'init-ibuffer)
- ;; Company
- (require 'init-company)
- ;; Window things
- (require 'init-windows)
- ;; Persp
- (require 'init-persp)
- ;; Org Mode
- (require 'init-org)
- ;; SES things
- (require 'init-spreadsheets)
- ;; Flycheck
- (require 'init-flycheck)
- ;; Snippets
- (require 'init-yasnippet)
- ;; LSP
- (require 'init-lsp)
- ;; Emacs Lisp
- (require 'init-emacs-lisp)
- ;; Assembly
- (require 'init-assembly)
- ;; C/C++/Objective-C
- (require 'init-cc)
- ;; Common Lisp
- (require 'init-common-lisp)
- ;; Dlang
- (require 'init-d)
- ;; .NET
- (require 'init-dotnet)
- ;; Elixir
- (require 'init-elixir)
- ;; Erlang
- (require 'init-erlang)
- ;; Janet
- (require 'init-janet)
- ;; Java
- (require 'init-java)
- ;; Lua
- (require 'init-lua)
- ;; Markdown
- (require 'init-markdown)
- ;; Nim
- (require 'init-nim)
- ;; Perl
- (require 'init-perl)
- ;; Ruby
- (require 'init-ruby)
- ;; Rust
- (require 'init-rust)
- ;; Shell
- (require 'init-sh)
- ;; Web stuff
- (require 'init-web)
- ;; Key things
- (require 'init-keybindings)
- ;;; init.el ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement