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

emacs配置文件之备份

2013年05月16日 ⁄ 综合 ⁄ 共 3203字 ⁄ 字号 评论关闭

(custom-set-variables
'(column-number-mode t);显示列号
;'(display-time-mode t)
'(size-indication-mode t)
'(transient-mark-mode nil)
'(global-linum-mode t)
'(cua-mode nil)
'(show-paren-mode t nil (paren))
)
(custom-set-faces
)
;我的Emacs配置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "/usr/local/share/emacs/my_plus");自己的插件包
;(require 'color-theme);主题颜色
;(color-theme-dark-blue)
(require 'setnu);第行前显示行号
(setnu-mode t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;设置颜色;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(set-cursor-color "Wheat")
(set-mouse-color "Wheat")
(set-foreground-color "Wheat")
(set-background-color "DarkSlateGray")
;;设置时间格式;;;;;;;;;;;;;;;;;;;;;;;;;;;
(display-time-mode t)
(setq display-time-12hr-format t)
(setq display-time-day-and-date t)
(setq visible-bell t);关闭出错提示声
(setq inhibit-startup-message t);关闭开启画面
(setq backup-inhibited t);;不产生备份
(setq auto-save-default nil);不生成名为#filename#的临时文件
(setq default-major-mode 'text-mode);;设置默认模式是text mode
(global-font-lock-mode t);语法高亮
(auto-image-file-mode t);打开图片显示功能
(setq x-select-enable-clipboard t);支持emacs和外部程序的粘贴
(setq frame-title-format '("" buffer-file-name "@emacs" ));标题栏显示buffer名
(setq default-directory "/home/blueboy/Program");设置缺省目录
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;鼠标滚轮,默认的滚动太快,这里改为3行;;;;;;
(defun up-slightly () (interactive) (scroll-up 3))
(defun down-slightly () (interactive) (scroll-down 3))
(global-set-key [mouse-4] 'down-slightly)
(global-set-key [mouse-5] 'up-slightly)
;;自定义按键;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(global-set-key [f1] 'shell);F1进入Shell
(global-set-key [C-f5] 'previous-error)
(global-set-key [f5] 'next-error)
(global-set-key [C-f3] 'python-shell);F3进入Python-Shell
(global-set-key [C-f6] 'gdb);调试
(setq compile-command "make -f Makefile")
(global-set-key [f7] 'compile);F7编译文件
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Python配置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;(require 'python-mode)
(setq auto-mode-alist
(cons '("//.py$" . python-mode) auto-mode-alist)
);自动关联文件
(setq interpreter-mode-alist
(cons '("python" . python-mode)
interpreter-mode-alist)
)
(autoload 'python-mode "python-mode" "Python editing mode." t)
;;C语言配置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun linux-c-mode()
;;;将回车代替C-j的功能,换行的同时对齐;;;;;;
(define-key c-mode-map [return] 'newline-and-indent)
(interactive)
(c-set-style "k&r");设置C程序的对齐风格
(c-toggle-auto-state);自动模式,在此种模式下当你键入{时,会自动根据你设置的对齐风格对齐
(c-toggle-hungry-state);此模式下,当按Backspace时会删除最多的空格,使得if缩进正常
(setq c-basic-offset 4);缩进设置为4
(imenu-add-menubar-index);在菜单中加入当前Buffer的函数索引
(which-function-mode);在状态条上显示当前光标在哪个函数体内部
)
;;C++语言配置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun linux-cpp-mode ()
(define-key c++-mode-map [return] 'newline-and-indent)
(interactive)
(c-set-style "Stroustrup")
(setq c-basic-offset 4)
(c-toggle-auto-state)
(c-toggle-hungry-state)
(imenu-add-menubar-index)
(which-function-mode)
)
(add-hook 'c-mode-hook 'linux-c-mode)
(add-hook 'c++-mode-hook 'linux-cpp-mode)
(setq imenu-sort-function 'imenu--sort-by-name);设置imenu的排序方式为按名称排序
(setq auto-mode-alist
(append '(("//.h$" . c++-mode)) auto-mode-alist))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

抱歉!评论已关闭.