2017-08-17 21:37:33 +02:00
|
|
|
;;; init.el --- Emacs Initialization File
|
|
|
|
;;
|
2019-07-21 00:37:46 +02:00
|
|
|
;; Copyright (c) 2017-2019 Wojciech Kozlowski
|
2017-08-17 21:37:33 +02:00
|
|
|
;;
|
2018-02-04 18:18:18 +01:00
|
|
|
;; Author: Wojciech Kozlowski <wk@wojciechkozlowski.eu>
|
2019-07-21 00:37:46 +02:00
|
|
|
;; Created: 2017-08-17
|
2017-08-17 21:37:33 +02:00
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
2017-08-17 21:38:30 +02:00
|
|
|
|
2018-07-07 22:34:00 +02:00
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -------------------------------------------------------------------------------------------------
|
2017-08-17 21:38:30 +02:00
|
|
|
;; Run init without garbage collection.
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -------------------------------------------------------------------------------------------------
|
2017-08-17 21:38:30 +02:00
|
|
|
|
|
|
|
(let ((gc-cons-threshold most-positive-fixnum))
|
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
2020-04-05 23:45:45 +02:00
|
|
|
;; Helper function to get correct configuration directory.
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
2020-04-05 23:45:45 +02:00
|
|
|
|
|
|
|
(defun emacs-dir (rel)
|
|
|
|
"Obtain full path to REL."
|
|
|
|
(concat (file-name-as-directory user-emacs-directory) rel))
|
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
2018-02-11 23:34:08 +01:00
|
|
|
;; Initialise and setup `package'.
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
2018-02-11 23:34:08 +01:00
|
|
|
|
|
|
|
(require 'package)
|
2020-11-22 11:17:49 +01:00
|
|
|
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
|
2018-02-11 23:34:08 +01:00
|
|
|
(package-initialize)
|
|
|
|
|
2019-12-15 16:06:26 +01:00
|
|
|
;; External .el files that are not available from MELPA.
|
2020-04-05 23:45:45 +02:00
|
|
|
(add-to-list 'load-path (emacs-dir "external"))
|
2018-10-29 00:35:48 +01:00
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
2018-11-06 02:14:48 +01:00
|
|
|
;; Load `emodule'.
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
2018-11-06 02:14:48 +01:00
|
|
|
|
2020-04-05 23:45:45 +02:00
|
|
|
(add-to-list 'load-path (emacs-dir "emodule"))
|
2018-11-06 02:14:48 +01:00
|
|
|
(require 'emodule)
|
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
2017-08-17 21:39:43 +02:00
|
|
|
;; Visual configuration.
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
2017-08-17 21:39:43 +02:00
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; Font ------------------------------------------------------------------------------------------
|
2017-08-17 23:41:32 +02:00
|
|
|
|
2017-08-19 04:03:34 +02:00
|
|
|
(let* ((font-name "Source Code Pro")
|
2019-07-22 09:48:04 +02:00
|
|
|
(font-size 10)
|
2017-08-19 04:03:34 +02:00
|
|
|
(font-spec (concat font-name "-" (int-to-string font-size))))
|
|
|
|
|
|
|
|
(set-frame-font font-spec nil t)
|
|
|
|
(add-to-list 'default-frame-alist `(font . ,font-spec))
|
|
|
|
(set-face-attribute 'italic nil ;; Emacs does not set italic face
|
|
|
|
:family (concat font-name "-Italic")))
|
2017-08-17 23:41:32 +02:00
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; Visual clutter --------------------------------------------------------------------------------
|
2017-08-17 21:39:43 +02:00
|
|
|
|
|
|
|
(scroll-bar-mode -1)
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
(menu-bar-mode -1)
|
2017-08-18 23:27:38 +02:00
|
|
|
(blink-cursor-mode -1)
|
2017-08-17 21:39:43 +02:00
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; Theme -----------------------------------------------------------------------------------------
|
2017-08-17 23:41:32 +02:00
|
|
|
|
2017-08-27 16:47:40 +02:00
|
|
|
;; Add the necessary paths.
|
2020-04-05 23:45:45 +02:00
|
|
|
(add-to-list 'load-path (emacs-dir "themes"))
|
|
|
|
(add-to-list 'custom-theme-load-path (emacs-dir "themes"))
|
2017-08-27 16:47:40 +02:00
|
|
|
|
|
|
|
;; Load the dark theme by default.
|
2017-08-27 16:07:18 +02:00
|
|
|
(load-theme 'havoc-dark t) ;; Load personal theme
|
2017-08-17 23:41:32 +02:00
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; Splash screen ---------------------------------------------------------------------------------
|
2018-11-06 02:14:48 +01:00
|
|
|
|
|
|
|
;; Add path.
|
2020-04-05 23:45:45 +02:00
|
|
|
(add-to-list 'load-path (emacs-dir "init-buffer"))
|
2019-07-21 00:37:46 +02:00
|
|
|
(require 'init-buffer)
|
2018-11-06 02:14:48 +01:00
|
|
|
|
|
|
|
;; Set the initial buffer.
|
2019-07-21 00:37:46 +02:00
|
|
|
(setq-default init-buffer-choice 'init-buffer/goto-buffer)
|
2018-11-06 02:14:48 +01:00
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
2017-08-24 23:41:18 +02:00
|
|
|
;; Change file in which custom variable changes are saved.
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
2017-08-29 22:05:06 +02:00
|
|
|
|
2020-04-05 23:45:45 +02:00
|
|
|
(setq-default custom-file (emacs-dir "custom.el"))
|
2017-08-24 23:41:18 +02:00
|
|
|
|
2021-09-24 14:52:53 +02:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
|
|
|
;; Load any custom variables straight away to make sure all custom values carry over.
|
|
|
|
;; -----------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(load custom-file 'noerror)
|
|
|
|
|
2017-08-24 23:41:18 +02:00
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; ******************************************************************************************** ;;
|
|
|
|
;; ;;
|
|
|
|
;; MODULES ;;
|
|
|
|
;; ;;
|
|
|
|
;; -------------------------------------------------------------------------------------------- ;;
|
|
|
|
;; ;;
|
|
|
|
;; ;;
|
|
|
|
;; Visual configuration must come before this point so that the frame can be set up before any ;;
|
|
|
|
;; time consuming package management. ;;
|
|
|
|
;; ;;
|
|
|
|
;; ;;
|
|
|
|
;; ******************************************************************************************** ;;
|
2017-08-24 23:41:18 +02:00
|
|
|
|
2017-08-25 00:08:47 +02:00
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
2017-08-25 23:37:01 +02:00
|
|
|
;; Load modules.
|
2020-11-22 11:17:49 +01:00
|
|
|
;; -----------------------------------------------------------------------------------------------
|
2017-08-24 22:41:24 +02:00
|
|
|
|
2017-09-03 02:21:35 +02:00
|
|
|
(emodule/init '(
|
2019-07-21 00:37:46 +02:00
|
|
|
emacs
|
|
|
|
helm
|
|
|
|
languages
|
|
|
|
modeline
|
|
|
|
org
|
|
|
|
programming
|
|
|
|
terminal
|
|
|
|
vcs
|
2017-09-02 14:45:42 +02:00
|
|
|
))
|
2017-08-24 22:41:24 +02:00
|
|
|
|
2017-08-24 23:41:18 +02:00
|
|
|
|
2020-11-22 11:17:49 +01:00
|
|
|
;; ******************************************************************************************** ;;
|
|
|
|
;; ;;
|
|
|
|
;; ;;
|
|
|
|
;; Any configuration that is not in a module or needs to override module settings should be set ;;
|
|
|
|
;; below this point. ;;
|
|
|
|
;; ;;
|
|
|
|
;; ;;
|
|
|
|
;; -------------------------------------------------------------------------------------------- ;;
|
|
|
|
;; ;;
|
|
|
|
;; END MODULES ;;
|
|
|
|
;; ;;
|
|
|
|
;; ******************************************************************************************** ;;
|
|
|
|
|
2017-08-28 00:25:14 +02:00
|
|
|
) ;; Reset garbage collection settings.
|
2018-07-07 22:34:00 +02:00
|
|
|
|
|
|
|
(provide 'init)
|
|
|
|
;;; init.el ends here
|