;;;C:\Documents and Settings\jims_mrs\Application Data
1 (load-file "D:/Program Files/emacs/HOME/.emacs")
2
3 ;;; Emacs Load Path
4 ;;(setq load-path (cons "D:/Program Files/emacs/HOME/.emacs" load-path))
D:\Program Files\emacs\HOME
1
2 (setenv "HOME" "D:/Program Files/emacs/HOME")
3 (setenv "PATH" "D:/Program Files/emacs/HOME")
4 ;;set the default file path
5 (setq default-directory "~/")
6 (add-to-list 'load-path "~/emacs/site-lisp")
7
8
9 ;;(server-start)
10
11
12
13
14 ;; 动态加载的代码
15 ;; M-x load-file,
16 ;; M-x eval-buffer
17
18 ;关闭启动画面
19 (custom-set-variables
20 ;; custom-set-variables was added by Custom.
21 ;; If you edit it by hand, you could mess it up, so be careful.
22 ;; Your init file should contain only one such instance.
23 ;; If there is more than one, they won't work right.
24 '(column-number-mode t)
25 '(display-time-mode t)
26 '(inhibit-startup-screen t)
27 '(show-paren-mode t)
28 '(truncate-partial-width-windows nil))
29
30 ;;设置个人信息
31 (setq user-full-name "mrx jimsmorong")
32 (setq user-mail-address "jimsmorong@gmail.com")
33
34 ;;加载颜色
35 (require 'color-theme)
36 ;;M-x color-theme-select
37 ;;选择哪一种颜色
38 (color-theme-comidia)
39
40 ;;加载lua mode
41 (require 'lua-mode)
42
43 ;;加载google_protobuf
44 (require 'protobuf-mode)
45
46 ;;加载CSope
47 (require 'xcscope) ;;加载xcscope
48
49 ;;加载yasnippet
50 ;;(require 'yasnippet/yasnippet) ;; not yasnippet-bundle
51 ;;(yas/initialize)
52 ;;(yas/load-directory "~/.emacs.d/plugins/yasnippet-0.6.1c/snippets")
53
54 ;;load browse-kill-ring
55 (require 'browse-kill-ring)
56 (global-set-key [(control c)(k)] 'browse-kill-ring)
57 (browse-kill-ring-default-keybindings)
58
59 ;;配置ido插件,这个可以使你在用C-x C-f打开文件的时候在后面有提示
60 ;;----------------------------------------------------------------------------------------
61 (require 'ido)
62 (ido-mode t)
63 ;;----------------------------------------------------------------------------------------
64
65
66
67
68 ;;加载tabbar.el
69 ;;------------------------------------------------------------------------------------------------------------------------------------------
70 (require 'tabbar)
71 (tabbar-mode t)
72 (global-set-key [(control shift tab)] 'tabbar-backward)
73 (global-set-key [(control tab)] 'tabbar-forward)
74 ;;默认的分组方法并不是每个人都喜欢,它会把后缀名相同的文件分为一组,
75 ;;比如说perl脚本都扔在一个组里,yaml文件又扔在另一个组里。写代码的时候,
76 ;;在这两个组里切换实在是太麻烦了!我就喜欢把除了Emacs Buffer之外的文件
77 ;;都放成一组,即我自己打开的文件放成一组
78 (setq tabbar-buffer-groups-function
79 (lambda (b) (list "All Buffers")))
80 (setq tabbar-buffer-list-function
81 (lambda ()
82 (remove-if
83 (lambda(buffer)
84 (find (aref (buffer-name buffer) 0) " '"))
85 (buffer-list))))
86
87 ;;------------------------------------------------------------------------------------------------------------------------------------------
88
89 ;;load line_number
90 ;;(set-scroll-bar-mode nil) ; no scroll bar, even in x-window system (recommended)
91 ;;(require 'wb-line-number)
92 ;;(wb-line-number-toggle)
93
94
95 ;;显示时间
96 (display-time)
97
98 ;;显示行号
99 (column-number-mode t)
100 (show-paren-mode t)
101
102 ;;去掉工具栏
103 (tool-bar-mode nil)
104
105 ;;去掉菜单栏
106 ;;ctrl+鼠标右键 可以按出菜单
107 ;;(menu-bar-mode nil)
108
109 ;;去掉滚动条
110 (set-scroll-bar-mode nil)
111
112 ;;关闭烦人的出错时的提示声
113 (setq visible-bell t)
114
115 ;;滚动页面时比较舒服,不要整页的滚动
116 (setq scroll-step 1
117 scroll-margin 3
118 scroll-conservatively 10000)
119
120 ;在标题栏显示buffer的名字
121 (setq frame-title-format "%b@emacs")
122
123 ;;设置默认工作目录
124 (setq default-directory "D:/Program Files/emacs/mrx")
125 ;;(setq default-directory "d:/mate2/dqprotocol")
126
127 ; F5:激活speedbar
128 (global-set-key [(f5)] 'speedbar-get-focus)
129
130 ;;动态增加减少字体大小
131 (defun sacha/increase-font-size ()
132 (interactive)
133 (set-face-attribute 'default
134 nil
135 :height
136 (ceiling (* 1.10
137 (face-attribute 'default :height)))))
138 (defun sacha/decrease-font-size ()
139 (interactive)
140 (set-face-attribute 'default
141 nil
142 :height
143 (floor (* 0.9
144 (face-attribute 'default :height)))))
145 (global-set-key (kbd "C-+") 'sacha/increase-font-size)
146 (global-set-key (kbd "C--") 'sacha/decrease-font-size)
147
148
149
150 (custom-set-faces
151 ;; custom-set-faces was added by Custom.
152 ;; If you edit it by hand, you could mess it up, so be careful.
153 ;; Your init file should contain only one such instance.
154 ;; If there is more than one, they won't work right.
155 '(default ((t (:inherit nil :stipple nil :background "Black" :foreground "SteelBlue" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight bold :height 90 :width normal :foundry "outline" :family #("微软雅黑" 0 4 (charset chinese-gbk)))))))
156
157 ;; read pdf
158 ;;(load-file "~/dos/emacs/doc-view.el")
159 ;;(require 'doc-view)
160
161
162
163
164
165
166 ;;
167 ;;(setq gnuwin32_bin "GetGnuWin32\gnuwin32\bin")
168 (setq gnuwin32_bin "D:/Program Files/GetGnuWin32/gnuwin32/bin;")
169
170 (setenv "PATH"
171 (concat
172 gnuwin32_bin
173 (getenv "PATH")
174 )
175 )
176
177
178 (require 'doc-view)
179
180 ;;配置linum插件,显示行号
181 ;;-----------------------------------------------------------------------------------
182 (require 'linum)
183 (global-linum-mode t)
184 ;;-----------------------------------------------------------------------------------
185
186
187 (defun my-insert-date ()
188 (interactive)
189 (insert "//")
190 (insert (user-full-name))
191 (insert "@")
192 (insert (format-time-string "%Y/%m/%d %H:%M:%S" (current-time))))
193 (global-set-key (kbd "C-c m d") 'my-insert-date)
194
195
196 (require 'cmake-mode)
将附件保存在D:\Program Files\emacs\ntemacs23\site-lisp
http://www.cppblog.com/Files/jimsmorong/site-lisp.zip