forked from xjasonli/homerc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.emacs
180 lines (133 loc) · 4.36 KB
/
.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
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
172
173
174
175
176
177
178
179
180
;; -*- Emacs-Lisp -*-
;; -*- coding:utf-8 -*-
;;
;; ------------------------------------------------------------------------------
;;
;; @file .emacs
;; @brief
;; @author iHuHoo.W ([email protected])
;; @date 2011-01-12 17:09:13
;;
;; Copyright (C) 2011 iHuHoo.W, all rights reserved.
;;
;; ------------------------------------------------------------------------------
;;
(defconst my-emacs-path "~/.emacs.d/" "my emacs config file path")
(defconst my-emacs-my-lisps-path (concat my-emacs-path "my-lisp/") "my lisp package")
(defconst my-emacs-vendor-lisps-path (concat my-emacs-path "site-lisp/") "the vendor lisp package")
(defconst my-emacs-settings-path (concat my-emacs-path "setting/") "my self emacs setting")
(defconst my-emacs-templates-path (concat my-emacs-path "templates/") "my templates")
;; add all subdir of 'my-emacs-path' to 'load-path'
(load (concat my-emacs-my-lisps-path "my-subdirs"))
(my-add-subdirs-to-load-path my-emacs-vendor-lisps-path)
(my-add-subdirs-to-load-path my-emacs-my-lisps-path)
(my-add-subdirs-to-load-path my-emacs-settings-path)
(setq stack-trace-on-error t)
;; 设置默认工作目录
(setq default-directory "~/work/")
;; user information
(require 'user-info-settings)
;; eval-after-load
;; http://emacser.com/eval-after-load.htm
(require 'eval-after-load)
;; ahei-misc for some common function
(require 'ahei-misc)
;; util
(require 'util)
;; ido
(require 'ido-settings)
;; uniquify
(require 'uniquify-settings)
;; generic copy
(require 'generic-copy)
;; org
(require 'org-settings)
;; alpha-window
(require 'alpha-window-settings)
;; global settings
(require 'global-settings)
;; goto line
(global-set-key [(control c) (control g)] 'goto-line)
;; un comment
(global-set-key (kbd "C-x M-;") 'uncomment-region)
;; hide region
;; (require 'hide-region)
;; (setq hide-region-before-string "+[...")
;; (setq hide-region-after-string "]\n")
;; (global-set-key (kbd "C-x M-r") 'hide-region-hide)
;; (global-set-key (kbd "C-x M-R") 'hide-region-unhide)
;; hide lines
;; (require 'hide-lines)
;; 启用以下功能
;(put 'narrow-to-region 'disabled nil)
;(put 'downcase-region 'disabled nil)
;(put 'dired-find-alternate-file 'disabled nil)
;; 括号自动完成
;(setq skeleton-pair t)
;(local-set-key (kbd "[") 'skeleton-pair-insert-maybe)
;(local-set-key (kbd "(") 'skeleton-pair-insert-maybe)
;(local-set-key (kbd "{") 'skeleton-pair-insert-maybe)
;(local-set-key (kbd "<") 'skeleton-pair-insert-maybe)
(defun visit-.emacs ()
"visit .emacs file"
(interactive)
(find-file (concat "~/" ".emacs")))
(global-set-key (kbd "C-x E") 'visit-.emacs)
;;------------------------------------------------------------------------------
;; artist-mode
;;------------------------------------------------------------------------------
;(autoload 'artist-mode "artist" "Enter artist-mode" t)
;; browse kill ring setting.
(require 'browse-kill-ring-settings)
;; yasnippet
(load "yasnippet-settings")
;; auto complete
(load "auto-complete-settings")
;; templates
(require 'template-settings)
;; auto inster
(require 'auto-insert-settings)
;; c/cpp settings
(require 'c-settings)
;; cedet
(require 'cedet-settings)
;; ECB
(require 'ecb-settings)
;; slime
(setq inferior-lisp-program "/opt/local/bin/sbcl")
(require 'slime)
(slime-setup)
;(require 'slime-settings)
;; doxymacs
;(require 'doxymacs-settings)
;; gdb settings
;(require 'gdb-settings)
;; git-emacs settings
(require 'git-emacs-settings)
;; grep settings
(require 'grep-settings)
;; lua settings
(require 'lua-settings)
;; php settings
(require 'php-settings)
;; java-script settings
(require 'js-settings)
;;------------------------------------------------------------------------------
;; CMake
;;------------------------------------------------------------------------------
;(require 'cmake-mode)
;(setq auto-mode-alist
; (append '(("CMakeLists\\.txt\\'" . cmake-mode)
; ("\\.cmake\\'" . cmake-mode))
; auto-mode-alist))
;; SQL for MySQL
(load "sql-settings")
;; font settings
(if window-system (load "font-settings"))
;; color theme
(load "color-theme-settings")
;; undo tree
(require 'undo-tree)
(global-undo-tree-mode)
;; maxframe
(require 'maxframe-settings)