-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.el
More file actions
171 lines (137 loc) · 5.14 KB
/
Copy pathinit.el
File metadata and controls
171 lines (137 loc) · 5.14 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
;;; init.el --- Startup file for Emacs. -*- lexical-binding: t; -*-
;; Copyright (C) 2017 Jerry Peng
;; Author: Jerry Peng <pr2jerry@gmail.com>
;;; Commentary:
;; The init system and the config structure are based on Chris
;; Barrett's amazing work: https://github.com/chrisbarrett/.emacs.d
;; Declares some variables and bootstraps the rest of the configuration.
;;
;; One main difference from other configurations out there is that I use git subtrees for
;; many core packages, instead of relying on the Emacs package manager.
;;; Code:
(setq gc-cons-threshold (* 800 1024))
(defconst emacs-start-time (current-time))
(unless noninteractive
(message "Loading %s..." load-file-name))
;; Bootstrap straight
(setq package-enable-at-startup nil)
(eval-and-compile
(defvar bootstrap-version 3)
(defvar bootstrap-file (concat user-emacs-directory "straight/repos/straight.el/bootstrap.el")))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(defconst straight-cache-autoloads t)
(defconst straight-check-for-modifications 'live)
(require 'straight bootstrap-file t)
(defconst use-package-verbose t)
(straight-use-package 'use-package)
(straight-use-package 'bind-map)
(eval-when-compile
(require 'recentf)
(require 'use-package))
(defalias 'use-package-handler/:ensure #'use-package-handler/:straight)
(defalias 'use-package-normalize/:ensure #'use-package-normalize/:straight)
(require 'seq)
(require 'subr-x)
(defun nw-init/init-load-path (&optional interactive-p)
"Add select subdirs of `user-emacs-directory' to the `load-path'.
If argument INTERACTIVE-P is set, log additional information."
(interactive "p")
(let* ((before load-path)
(lisp-dir (expand-file-name "lisp" user-emacs-directory))
(config-dir (expand-file-name "config" user-emacs-directory))
(git-subtrees
(seq-filter #'file-directory-p
(directory-files lisp-dir t "^[^.]")))
(config-subtrees
(seq-filter #'file-directory-p
(directory-files config-dir t "^[^.]"))))
(dolist (path (append (list lisp-dir config-dir) config-subtrees git-subtrees))
(add-to-list 'load-path path)
(add-to-list 'Info-default-directory-list path)
(add-to-list 'load-path (concat path "/emacs"))
(add-to-list 'load-path (concat path "/elisp"))
(add-to-list 'load-path (concat path "/lisp")))
(setq load-path (seq-filter #'file-directory-p load-path))
(setq Info-default-directory-list (seq-filter #'file-directory-p Info-default-directory-list))
(when interactive-p
(if-let (added (seq-difference load-path before))
(message "Load path updated. Added: %S" added)
(message "No change to load-path")))))
(nw-init/init-load-path)
;; major mode hydra
;(require 'major-mode-hydra)
;; Load features.
(use-package nw-base)
(use-package nw-evil)
(use-package nw-ivy)
(use-package nw-projectile)
(use-package nw-eyebrowse)
(use-package nw-magit)
(use-package nw-yaml)
(use-package nw-markdown)
(use-package nw-lsp)
(use-package nw-company)
(use-package nw-flycheck)
(use-package nw-python)
;(use-package jp-smartparens)
;(use-package jp-ivy)
;(use-package jp-company)
;(use-package jp-flycheck)
;(use-package jp-projectile)
;
;(use-package jp-magit)
;(use-package jp-restclient)
;(use-package jp-yasnippet)
;(use-package jp-org)
;(use-package jp-docker)
;(use-package jp-yaml)
;(use-package jp-markdown)
;; Programming language support
;(use-package jp-go)
;(use-package jp-scala)
;(use-package jp-clojure)
;(use-package jp-php)
;(use-package jp-puppet)
;(use-package jp-protobuf)
;;; Print overall startup time.
(unless noninteractive
(let ((elapsed (float-time (time-subtract (current-time) emacs-start-time))))
(message "Loading %s...done (%.3fs)" load-file-name elapsed))
(add-hook 'after-init-hook
`(lambda ()
(let ((elapsed (float-time (time-subtract (current-time)
emacs-start-time))))
(message "Loading %s...done (%.3fs) [after-init]"
,load-file-name elapsed)))
t))
(provide 'init)
;;; init.el ends here
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
(quote
("7ef2884658a1fed818a11854c232511fa25721c60083a2695e6ea34ce14777ee" default)))
'(package-selected-packages (quote (flycheck)))
'(safe-local-variable-values
(quote
((eval progn
(aggressive-indent-mode -1)
(define-clojure-indent
(expect 0)
(expect-search 0)
(expect-next 0)))))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)