emacs/init.el
laurensmiers 586aa741df Fix lag in LSP mode due to garbage collection
Used profiler to determine more than 80% of time was spent in garbage
collection...
Lowering the value back to the default fixes the lag.
2020-04-20 14:07:56 +02:00

35 lines
1.3 KiB
EmacsLisp

;; IMPORTANT: add (require 'package), else package-archives is not declared (void-variable)
(require 'package)
(setq package-enable-at-startup nil)
;; add melpa-stable to package-archives
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives
'("org" . "https://orgmode.org/elpa/") t)
;; MUST be called after package-archives is updated
(package-initialize)
;;; Bootstrapping use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
;;; Increase garbage collection threshold during init but leave it to the default value after
;;; There are a LOT of articles/sites/... discussing this:
;;; https://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/
;;; https://jonnay.github.io/emagicians-starter-kit/Emagician-Base.html
;;; ...
(let ((gc-cons-threshold most-positive-fixnum))
;; This is the actual config file. It is omitted if it doesn't exist so emacs won't refuse to launch.
(when (file-readable-p "~/.emacs.d/config.org")
(org-babel-load-file (expand-file-name "~/.emacs.d/config.org")))
;; If it exists, load some project-specific configurations.
(when (file-readable-p "~/.emacs.d/project.org")
(org-babel-load-file (expand-file-name "~/.emacs.d/project.org")))
)
(provide 'init)