更新:如果 windows 下用 emacs 为了用 g++,参照 windows下配置gcc/g++/gdb + emacs编译环境 中所说的修改系统路径即可。
好不容易学会的。。。以后不定期更新~~~
为了增强可读性,我有做注释。。。
(set-background-color "gray19")
(set-foreground-color "wheat")
(set-cursor-color "wheat")
(set-mouse-color "wheat")
(set-default-font "Consolas-14")
(global-font-lock-mode t);;高亮
(global-linum-mode t)
(global-auto-revert-mode t)
(custom-set-variables '(inhibit-startup-screen t));;免滚动栏
(tool-bar-mode nil);;免工具栏
(show-paren-mode 1);;括号匹配
(fset 'yes-or-no-p 'y-or-n-p);;酱油的
(setq x-select-enable-clipboard t);;外部拷贝
(setq make-backup-files nil)
(setq default-tab-width 2);;缩进
(cua-mode t);;windows 快捷键
(global-set-key (kbd "RET") 'newline-and-indent);;自动缩进
(global-set-key (kbd "C-s") 'save-buffer)
(global-set-key (kbd "C-a") 'mark-whole-buffer)
(global-set-key (kbd "C-o") 'find-file)
(global-set-key (kbd "C-w") 'kill-buffer)
(global-set-key (kbd "C-<tab>") 'other-window)
(global-set-key [f7] 'shell-command);;用来运行什么的
(global-set-key [C-f7] 'gdb)
;(set-background-color "black")
;(set-foreground-color "wheat")
;(set-cursor-color "wheat")
(set-default-font "Courier New-12")
(global-auto-revert-mode t)
(global-set-key (kbd "RET") 'newline-and-indent)
(global-set-key (kbd "C-s") 'save-buffer)
(global-set-key (kbd "C-a") 'mark-whole-buffer)
(global-set-key (kbd "C-o") 'find-file)
(global-set-key (kbd "C-w") 'kill-buffer)
(global-set-key (kbd "C-q") 'replace-string)
(global-set-key (kbd "C-f") 'search-forward)
(global-set-key [M-f4] 'kill-emacs)
(global-set-key [f9] 'compile)
(global-set-key [f7] 'gdb)
(global-set-key [C-f9] 'shell-command)
;(defun drj-hook()
;(c-set-style "linux")
;(setq c-basic-offset 2
;tab-width 2))
;(add-hook 'c-mode-common-hook 'drj-hook)
(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.
'(cua-mode t nil (cua-base))
'(default-frame-alist (quote ((tool-bar-lines . 0) (menu-bar-lines . 1) (width . 100) (alpha . 95))))
'(global-linum-mode t)
'(inhibit-startup-screen t)
'(make-backup-files nil)
'(show-paren-mode t)
'(tab-always-indent t)
'(tab-width 2))
(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.
'(default ((t (:inherit nil :stipple nil :background "SystemWindow" :foreground "SystemWindowText" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "outline" :family "Courier New")))))
(set-background-color "black")
(set-foreground-color "wheat")
(set-cursor-color "wheat")
(set-default-font "Courier 10 pitch-12")
(global-auto-revert-mode t)
(dolist (charset '(kana han symbol cjk-misc bopomofo))
(set-fontset-font (frame-parameter nil 'font)
charset
(font-spec :family "Microsoft Yahei" :size 14)))
(global-set-key (kbd "RET") 'newline-and-indent)
(global-set-key (kbd "C-s") 'save-buffer)
(global-set-key (kbd "C-a") 'mark-whole-buffer)
(global-set-key (kbd "C-o") 'find-file)
(global-set-key (kbd "C-w") 'kill-buffer)
(global-set-key (kbd "C-q") 'replace-string)
(global-set-key (kbd "C-f") 'search-forward)
(global-set-key [M-f4] 'kill-emacs)
(global-set-key [f9] 'compile)
(global-set-key [f7] 'gdb)
(global-set-key [C-f9] 'shell-command)
(defun drj-hook()
(c-set-style "gnu")
(setq c-basic-offset 2
tab-width 2))
(add-hook 'c-mode-common-hook 'drj-hook)
(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.
'(cua-mode t nil (cua-base))
'(default-frame-alist (quote ((tool-bar-lines . 0) (menu-bar-lines . 1) (width . 140) (height . 40) (alpha . 90))))
'(global-linum-mode t)
'(inhibit-startup-screen t)
'(make-backup-files nil)
'(show-paren-mode t)
'(tab-always-indent t)
'(tab-width 2))
(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.
)