现在的位置: 首页 > 综合 > 正文

我的emacs23配置文件–用于方便git上传代码

2013年10月19日 ⁄ 综合 ⁄ 共 1553字 ⁄ 字号 评论关闭

(set-background-color "dim gray") ;; 使用黑色背景
(set-foreground-color "white") ;; 使用白色前景

(set-face-foreground 'region "magenta")  ;; 区域前景颜色设为红色
(set-face-background 'region "cyan")
(put 'upcase-region 'disabled nil)

(set-default-font "Ubuntu Mono-14")

(require 'linum)
(global-linum-mode t)

(setq c-basic-offset 4)
(setq default-tab-width 4)
(setq-default indent-tabs-mode nil)

;;不产生备份文件和临时文件
(setq make-backup-files nil)

;;显示行号
(require 'linum)
(global-linum-mode t)

;;设置tab为4个空格的宽度
(setq c-basic-offset 4)
(setq default-tab-width 4)
(setq-default indent-tabs-mode nil)

(setq x-select-enable-clipboard t)

; deal with white spaces
(require 'whitespace)
(global-whitespace-mode)
(setq whitespace-style
      '(face trailing tabs lines lines-tail empty
             space-after-tab space-before-tab))
(add-hook 'before-save-hook 'delete-trailing-whitespace)

;; Show line number
(require 'linum)
(global-linum-mode t)
(setq column-number-mode t)
(setq line-number-node t)
(setq linum-format "%5d ")
(add-hook 'linum-before-numbering-hook
          (lambda ()
            (let ((w (+
                      (length
                       (number-to-string
                        (count-lines (point-min) (point-max))
                        ))
                      2)
                     ))
              (setq linum-format
                    `(lambda (line)
                       (propertize (concat
                                    (truncate-string-to-width
                                     "" (- ,w (length (number-to-string line)))
                                     nil ?x2007)
                                    (number-to-string line))
                                   'face 'linum))))))

抱歉!评论已关闭.