-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot_emacs
127 lines (84 loc) · 2.76 KB
/
dot_emacs
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
;;; dot_emacs --- Dot Emacs file of Dylan.Wen
;;; Commentary:
;;; Code:
;; 每节(section)开始于以3个分号开始的行
;; path utils
(defun file-directory (file-name)
"Return the directory of FILE-NAME, following symlink."
(let ((symlink-target (file-symlink-p file-name)))
(cond ((null symlink-target)
(file-name-directory file-name))
((stringp symlink-target)
(file-name-directory
(expand-file-name symlink-target (file-name-directory file-name))))
(t
(error "Corrupted symlink. %S" file-name)))))
(defun current-directory ()
"Return current directory."
(file-directory (or buffer-file-name load-file-name)))
;;; adding load path
(defconst import-path
(concat (current-directory) "import/") "另外导入的emacs lisp包的路径.")
(defconst site-lisp-path
(concat (current-directory) "site-lisp/") "自己写的emacs lisp配置/增强包路径.")
;; 加载`my-subdirs'库
(load (concat site-lisp-path "my-subdirs"))
;; 把`import-path'与`site-lisp-path'的所有子目录都加到`load-path'
(my-add-subdirs-to-load-path import-path)
(my-add-subdirs-to-load-path site-lisp-path)
(require 'package-settings)
(dw-package-check-all-installed)
;; 一些基本的小函数
(require 'ahei-misc)
;; 利用`eval-after-load'加快启动速度的库
(require 'eval-after-load)
(require 'util)
(require 'dw-functionals)
;;; load settings for extensions
(require 'misc-settings)
;;(require 'redo+-settings)
(require 'undo-tree-settings)
(require 'isearch-settings)
(require 'linum-settings)
(require 'mode-line-settings)
(require 'minibuffer-settings)
(require 'ibuffer-settings)
;; 为重名的buffer在前面加上其父目录的名字,让buffer的名字区分开来
;; 而不是单纯的加一个没有太多意义的序号
(require 'uniquify)
(setq uniquify-buffer-name-style 'forward)
(require 'dired-settings)
(require 'fiplr-settings)
(require 'ido-settings)
(require 'helm-settings)
(require 'smex-settings)
(require 'session-settings)
(require 'desktop-settings)
(require 'saveplace-settings)
(require 'time-stamp-settings)
(require 'dict-settings)
(require 'calendar-settings)
;;; load software development settings
(require 'dev-settings)
(require 'appearance-settings)
(require 'windmove-settings)
(require 'windresize-settings)
(require 'winner-mode-settings)
(require 'keybinding-settings)
(require 'server-settings)
;;; system dependent loading
(case system-type
(`darwin
(progn
(require 'osx-settings)))
(`gnu/linux
(progn
(require 'linux-settings))))
;;; additional emacs lisp
;; load elisp of Writing GNU Emacs Extensions, 1st
;; Bob Glickstein 1997
(require 'writing-emacs-extensions)
;; Local Variables:
;; mode: emacs-lisp
;; End:
;;; dot_emacs ends here