summary refs log tree commit diff
path: root/emacs/init.el
blob: 9c92d65925a448ad54939f947c6ee61981498a8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
;;; init.el --- Initialize my Emacs configuration
;;; Commentary:

;;; Code:

(setq gc-cons-threshold 64000000)
(add-hook 'after-init-hook #'(lambda ()
                               ;; restore after startup
                               (setq gc-cons-threshold 800000)))

(require 'package)

(add-to-list 'package-archives
	     '("melpa" .
	       "https://melpa.org/packages/"))

(progn
  (message "initializing package")
  (package-initialize))

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(eval-when-compile (require 'use-package))

(setq use-package-verbose t)
(setq use-package-always-ensure nil)

(defun my/package-install-refresh-contents (&rest args)
  "Refresh the package content, takes an optional ARGS."
  ;; Whenever use-package statements use ensure (directly or via
  ;; use-package-always-ensure), we need to refresh the package contents first,
  ;; as installation fails otherwise:
  ;; https://github.com/jwiegley/use-package/issues/256#issuecomment-263313693
  (package-refresh-contents)
  (advice-remove 'package-install 'my/package-install-refresh-contents))

(advice-add 'package-install :before 'my/package-install-refresh-contents)

(add-to-list 'load-path (expand-file-name "custom/" user-emacs-directory))
(add-to-list 'load-path (expand-file-name "elisp/" user-emacs-directory))

(require 'my-settings)
(require 'my-ui)
(require 'my-navigation)
(require 'my-completion)
(require 'my-edit)
(require 'my-text)
(require 'my-git)
(require 'my-org)
(require 'my-conf)
(require 'my-prog)
(require 'my-eshell)
(require 'my-tramp)
(require 'my-notmuch)

(require 'my-buffers)
(require 'my-git-extra)
(require 'my-strings)
(require 'my-web)
(require 'my-work)
(require 'my-packages-extra)

;;; init.el ends here