-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinit.el
59 lines (47 loc) · 1.72 KB
/
init.el
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
;; 添加文件加载路径
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(add-to-list 'load-path "~/.emacs.d/config")
(add-to-list 'load-path "~/.emacs.d/site_lisp")
(defvar root-dir (file-name-directory load-file-name)
"emacs配置的根目录")
(defvar savefile-dir (expand-file-name "savefile" root-dir)
"这个文件夹存储emacs自动生成的文件")
(defvar backup-dir (expand-file-name "backup" savefile-dir)
"存储emacs生成的备份文件")
;; 创建savefile文件夹
(unless (file-exists-p savefile-dir)
(make-directory savefile-dir))
;; 创建备份文件夹
(unless (file-exists-p backup-dir)
(make-directory backup-dir))
;;不使用emacs的默认配置
(setq inhibit-default-init t)
;; 配置环境变量
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell (replace-regexp-in-string
"[ \t\n]*$"
""
(shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq eshell-path-env path-from-shell) ; for eshell users
(setq exec-path (split-string path-from-shell path-separator))))
(when window-system (set-exec-path-from-shell-PATH))
;;; 加载自己的配置
;; 安装软件包
(load "init-package.el")
;; 基础配置
(load "init-base.el")
;; 配置界面
(load "init-ui.el")
;; 零散配置
(load "init-misc.el")
;; 添加一些收集的函数
(load "init-func.el")
;; 配置开发环境
(load "init-dev.el")
;; 配置快捷键
(load "init-kbd.el")