- 论坛徽章:
- 0
|
![]()
文件:
setnu.el.zip
大小:
5KB
下载:
下载
(require 'font-lock)
;;enable syntax highlighting, it's different with emacs
(set-face-foreground 'font-lock-function-name-face "red3")
(set-face-foreground 'font-lock-keyword-face "blue3")
(set-face-foreground 'font-lock-comment-face "dark green")
(set-face-foreground 'font-lock-type-face "blue3")
;显示匹配的括号
(setq show-paren-mode t)
(setq-default transient-mark-mode t)
(setq inhibit-startup-message t)
(setq column-number-mode t)
(setq mouse-yank-at-point t)
(setq visible-bell t)
;设置窗口大小
(if window-system
(setq default-frame-alist
(append
'((font . "8x13")
(top . 0)
(left . 0)
(width . 132)
(height . 50))
default-frame-alist)))
;启动时不显示窗口信息
(setq inhibit-startup-message t)
;不要backup文件
(setq make-backup-files nil)
;;在标题栏显示buffer的名字,而不是
emacs@xxxxx.com
这样没用的提示。
;;(setq frame-title-format "
[email=xemacs@%b]xemacs@%b[/email]
")
(setq frame-title-format "%b @@others@@ %f")
;让 Emacs 可以直接打开和显示图片。
(setq auto-image-file-mode t)
;设置默认的工作目录
(setq default-directory "e:/src/")
;显示行号, use setnu.el
(require 'setnu)
(setq setnu-mode t)
(setq turn-on-setnu-mode t)
(add-hook 'text-mode-hook 'turn-on-setnu-mode)
(add-hook 'python-mode-hook 'turn-on-setnu-mode)
(add-hook 'cperl-mode-hook 'turn-on-setnu-mode)
(add-hook 'cc-mode-hook 'turn-on-setnu-mode) ;;cc-mode不起作用,why
(add-hook 'c-mode-hook 'turn-on-setnu-mode)
(add-hook 'c++-mode-hook 'turn-on-setnu-mode)
;;设置cc-mode
(require 'cc-mode)
(defun my-c-mode-common-hook ()
(c-set-style "stroustrup") ;; 代码缩进风格
(c-toggle-auto-hungry-state t) ;;删除时一口吃掉前或后所有的空格
(c-toggle-hungry-state t)
(setq tab-width 4 ;; tab width 控制
indent-tabs-mode nil)
(setq c-cleanup-list ;; clean up 方式选择, 详见帮助.
'(scope-operator
empty-defun-braces
defun-close-semi)))
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/16953/showart_262231.html |
|