2023-10-23 08:52:59 +01:00
|
|
|
;;; init.el -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
;;; Initial phase.
|
|
|
|
|
|
|
|
;; Load the custom file if it exists. Among other settings, this will
|
|
|
|
;; have the list `package-selected-packages', so we need to load that
|
|
|
|
;; before adding more packages. The value of the `custom-file'
|
|
|
|
;; variable must be set appropriately, by default the value is nil.
|
|
|
|
;; This can be done here, or in the early-init.el file.
|
|
|
|
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
|
|
|
|
(when (and custom-file (file-exists-p custom-file))
|
2023-10-23 17:28:05 +01:00
|
|
|
(load custom-file nil 'nomessage))
|
2023-10-23 08:52:59 +01:00
|
|
|
|
2023-10-23 17:28:05 +01:00
|
|
|
;; Add custom modules to the `load-path'
|
|
|
|
(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory))
|
|
|
|
|
|
|
|
;; Adds crafted-emacs modules to the `load-path'
|
|
|
|
(setq crafted-emacs-home (expand-file-name "crafted-emacs" user-emacs-directory))
|
|
|
|
(add-to-list 'load-path (expand-file-name "modules" crafted-emacs-home))
|
2023-10-23 08:52:59 +01:00
|
|
|
|
|
|
|
;;; Configuration phase
|
|
|
|
|
|
|
|
;; Some example modules to configure Emacs. Don't blindly copy these,
|
|
|
|
;; they are here for example purposes. Find the modules which work
|
|
|
|
;; for you and add them here.
|
2023-10-23 17:28:05 +01:00
|
|
|
(require 'crafted-completion-config)
|
|
|
|
(require 'crafted-defaults-config)
|
|
|
|
(require 'crafted-ide-config)
|
|
|
|
(require 'crafted-org-config)
|
|
|
|
(require 'crafted-startup-config)
|
|
|
|
(require 'crafted-ui-config)
|
|
|
|
(require 'crafted-workspaces-packages)
|
|
|
|
(require 'crafted-writing-packages)
|
2023-10-23 08:52:59 +01:00
|
|
|
|
|
|
|
;;; Optional configuration
|
|
|
|
|
2023-10-23 17:28:05 +01:00
|
|
|
;; Set theme to Tokyo Night from doom-themes
|
|
|
|
(load-theme 'doom-tokyo-night t)
|
|
|
|
(add-to-list 'default-frame-alist '(font . "FiraCode Nerd Font-12"))
|
|
|
|
(global-prettify-symbols-mode)
|
|
|
|
|
2023-10-23 08:52:59 +01:00
|
|
|
;; Profile emacs startup
|
|
|
|
(defun crafted-startup-example/display-startup-time ()
|
|
|
|
"Display the startup time after Emacs is fully initialized."
|
|
|
|
(message "Crafted Emacs loaded in %s."
|
|
|
|
(emacs-init-time)))
|
|
|
|
(add-hook 'emacs-startup-hook #'crafted-startup-example/display-startup-time)
|
|
|
|
|
|
|
|
;; Set default coding system (especially for Windows)
|
|
|
|
(set-default-coding-systems 'utf-8)
|
2023-10-23 17:28:05 +01:00
|
|
|
(set-terminal-coding-system 'utf-8)
|
|
|
|
(set-keyboard-coding-system 'utf-8)
|
|
|
|
|
|
|
|
;; Set org directory
|
|
|
|
(setq org-directory "~/Org")
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-23 08:52:59 +01:00
|
|
|
|