aboutsummaryrefslogtreecommitdiff
path: root/emacs/init.el
blob: 3048b9ce72d787ccca7dde41f5516a2735c4a1fc (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
;;; init.el --- My Emacs configuration

;; Copyright (C) 2016 Miquel Sabaté Solà <mikisabate@gmail.com>
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:
;;
;; This is my personal Emacs configuration.  I wouldn't expect much to be
;; honest :)

;;; Credits:
;;
;; I've built this file by simply scavenging from other people's
;; emacs.d/dotfiles repositories. I have taken lots of pieces from here and
;; there, but most notably:
;;  - @ereslibre:   https://github.com/ereslibre/dotfiles
;;  - @dmacvicar:   https://github.com/dmacvicar/dotfiles
;;  - @bbatsov:     https://github.com/bbatsov/emacs.d
;;  - @aaronbieber: https://github.com/aaronbieber/dotfiles
;;  - @purcell:     https://github.com/purcell/emacs.d

;;; Code:

;;; Preface

;; I'm sticking with the major version I'm using, deal with it.
(unless (>= emacs-major-version 24)
  (error "Don't be a cheap bastard and upgrade to at least GNU Emacs 24"))

;; Temporarily reduce garbage collection so startup time is lower. Idea taken
;; from @purcell.
(defconst mssola-initial-gc-cons-threshold gc-cons-threshold
  "Initial value of `gc-cons-threshold' at start-up time.")
(setq gc-cons-threshold (* 1024 1024 1024))
(add-hook 'after-init-hook
          (lambda () (setq gc-cons-threshold mssola-initial-gc-cons-threshold)))

;;; User name and email.

(setq user-full-name "Miquel Sabaté Solà"
      user-mail-address "mikisabate@gmail.com")

;;; Basic configuration

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

(require 'init-general)
(require 'init-calendar)
(require 'defuns)

;;; Custom Lisp

(byte-compile-file (concat user-emacs-directory "lisp/g.el") t)

;;; Initialize package and use-package.

(require 'package)

(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/") t)

(package-initialize)

;; I'm using use-package to handle my installed packages. I don't know if it's
;; the best option or what because I haven't tested all the package managers
;; for Emacs out there. After trying some custom functions to handle
;; package-install, I decided on use-package because I feel more well-organized.
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

;; And load the configuration for all the packages being used.

(require 'init-project)
(require 'init-edit)
(require 'init-misc)
(require 'init-evil)
(require 'init-magit)
(require 'init-mu4e)
(require 'init-lang)

(provide 'init)
;;; init.el ends here