diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2023-06-10 09:36:37 +0200 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2023-07-02 13:52:12 +0200 |
commit | ef565a486511cbbb86e0d1f80264b3b57d2ac88a (patch) | |
tree | 4e0b04e78f288985a629ad8b9a8e56eb266de6a4 /.config/emacs/jd-emacs/jd-emacs-init.el | |
parent | 2b62ae597cc6a4c213f7d4b54b112ff9c216dbaa (diff) | |
download | dotfiles-ef565a486511cbbb86e0d1f80264b3b57d2ac88a.tar.gz dotfiles-ef565a486511cbbb86e0d1f80264b3b57d2ac88a.zip |
Migrate from .org to .el Emacs config.
Diffstat (limited to '.config/emacs/jd-emacs/jd-emacs-init.el')
-rw-r--r-- | .config/emacs/jd-emacs/jd-emacs-init.el | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/.config/emacs/jd-emacs/jd-emacs-init.el b/.config/emacs/jd-emacs/jd-emacs-init.el new file mode 100644 index 0000000..7f80cac --- /dev/null +++ b/.config/emacs/jd-emacs/jd-emacs-init.el | |||
@@ -0,0 +1,81 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (defvar jd-emacs/directory | ||
7 | (concat user-emacs-directory | ||
8 | "/jd-emacs/") | ||
9 | "Path to jd-emacs config directory.") | ||
10 | |||
11 | (defun jd-emacs/load (file-name) | ||
12 | "Load file from jd-emacs directory. | ||
13 | FILE-NAME - file name to load." | ||
14 | (let ((file (expand-file-name (concat jd-emacs/directory | ||
15 | "jd-emacs-" file-name ".el")))) | ||
16 | (load file))) | ||
17 | |||
18 | (setq gc-cons-threshold (* 2 1000 1000)) | ||
19 | |||
20 | |||
21 | (defun jd/display-startup-time () | ||
22 | (message "Emacs loaded in %s with %d garbage collections." | ||
23 | (format "%.2f seconds" | ||
24 | (float-time | ||
25 | (time-subtract after-init-time before-init-time))) | ||
26 | gcs-done)) | ||
27 | |||
28 | |||
29 | (defun jd-emacs/startup () | ||
30 | "This procedure will run after Emacs startup." | ||
31 | (electric-pair-mode 1) | ||
32 | (global-company-mode 1) | ||
33 | (jd/display-startup-time)) | ||
34 | |||
35 | (setq gc-cons-threshold (* 50 1000 1000)) | ||
36 | (add-hook 'emacs-startup-hook #'jd-emacs/startup) | ||
37 | |||
38 | (setq user-full-name "Jakub Dlugosz" | ||
39 | user-mail-address "jdlugosz963@gmail.com") | ||
40 | |||
41 | (setq backup-directory-alist '(("." . "~/.cache/emacs/backup")) | ||
42 | backup-by-copying t | ||
43 | version-control t | ||
44 | delete-old-versions t | ||
45 | kept-new-versions 20 | ||
46 | kept-old-versions 5) | ||
47 | |||
48 | (setq user-emacs-directory "~/.cache/emacs") | ||
49 | |||
50 | (require 'package) | ||
51 | (setq package-archives '(("melpa" . "https://melpa.org/packages/") | ||
52 | ("org" . "https://orgmode.org/elpa/") | ||
53 | ("gnu-devel" . "https://elpa.gnu.org/devel/") | ||
54 | ("elpa" . "https://elpa.gnu.org/packages/"))) | ||
55 | (package-initialize) | ||
56 | |||
57 | (unless package-archive-contents | ||
58 | (package-refresh-contents)) | ||
59 | |||
60 | (unless (package-installed-p 'use-package) | ||
61 | (package-install 'use-package)) | ||
62 | |||
63 | (setq use-package-always-ensure t) | ||
64 | |||
65 | (add-to-list 'load-path (expand-file-name "~/.config/emacs/jd/")) | ||
66 | |||
67 | (require 'use-package) | ||
68 | |||
69 | |||
70 | (jd-emacs/load "keys") | ||
71 | (jd-emacs/load "ui") | ||
72 | (jd-emacs/load "org-mode") | ||
73 | (jd-emacs/load "dev") | ||
74 | (jd-emacs/load "apps") | ||
75 | (jd-emacs/load "custom") | ||
76 | |||
77 | |||
78 | (setq gc-cons-threshold (* 2 1000 1000)) | ||
79 | |||
80 | |||
81 | ;; jd-int.el ends here | ||