OI 用 Emacs 配置文件

更新:如果 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.
)


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值