45fan.com - 路饭网

搜索: 您的位置主页 > 网络频道 > 阅读资讯:emacs的配置文件的详细介绍

emacs的配置文件的详细介绍

2016-09-02 08:26:03 来源:www.45fan.com 【

emacs的配置文件的详细介绍

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;; .emacs
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq gnus-group-name-charset-group-alist '((".*" . gb2312)))

(set-keyboard-coding-system 'chinese-iso-8bit)
(set-selection-coding-system 'chinese-iso-8bit)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;打开语法加亮
(cond ((fboundp 'global-font-lock-mode)
;; Load the font-lock package.
(require 'font-lock)
;; Maximum colors
(setq font-lock-maximum-decoration t)
;; Turn on font-lock in all modes that support it
(global-font-lock-mode t)))

;;加亮选中部分
(transient-mark-mode t)

;;关闭起动时的那个“开机画面”。
(setq inhibit-startup-message t)

;;显示列号。
(setq column-number-mode t)

;;不要在鼠标点击的地方插入剪贴板的内容,不然你的文档很容易变得乱七八糟。
(setq mouse-yank-at-point t)

;;括号匹配时加亮显示另外一边的括号,而不是烦人的跳到另一个括号。
(show-paren-mode t)
(setq show-paren-style 'parentheses)

;;光标靠近鼠标指针时,让鼠标指针自动让开,别挡住视线。
(mouse-avoidance-mode 'animate)

;;在标题栏显示buffer的名字,而不是 emacs@!#*&!(&@# 这样没用的提示。
(setq frame-title-format "emacs@%b")

;;设置一下备份时的版本控制,这样更加安全。
(setq version-control t)
(setq kept-new-versions 3)
(setq delete-old-versions t)
(setq kept-old-versions 2)
(setq dired-kept-versions 1)

;;设置自动备份文件保存的目录,以免把你的磁盘弄得乱七八糟(你可以
;;去掉这一行试试看:P ~/.autosave 表示 主目录下的一个叫.autosave 的子目录,
;;按照前面的方法设置主目录。
(setq backup-directory-alist '(("." . "~/.autosave")))

;;让 dired 可以递归的拷贝和删除目录。
(setq dired-recursive-copies 'top)
(setq dired-recursive-deletes 'top)

;;滚轮支持
(setq mouse-wheel-mode t)

;;一个加强的 buffer 列表模式
;(require 'ibuffer)
;(global-set-key (kbd "C-x C-b") 'ibuffer)


;;浏览剪贴板中的内容,绑定到 'C-c k'.
;(require 'browse-kill-ring)
;(global-set-key [(control c)(k)] 'browse-kill-ring)
;(browse-kill-ring-default-keybindings)

;;ido mode. 超强的buffer切换工具, Emacs 也有通常编辑器的那种
;;在 Tab 中选择 buffer 的 mode,但是用了ido 以后,我再也不需要
;;他它了,ido mode 是我见过最方便的 buffer 切换模式。
;(require 'ido)
;(ido-mode t)

;;极强的自动补全,帮定到 M-/ 上面了。基本就是,你编辑了一段时间以后,
;;只要输入字符串的前几个字符,按一下 M-/ ,就会补全后面的,多按几次可以选择。
;;补全的原则是"就近选择",试试就知道了,多数情况都让人满意。

(global-set-key [(meta ?/)] 'hippie-expand)

(setq hippie-expand-try-functions-list
'(try-expand-dabbrev
try-expand-dabbrev-visible
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-complete-file-name-partially
try-complete-file-name
try-expand-all-abbrevs
try-expand-list
try-expand-line
try-complete-lisp-symbol-partially
try-complete-lisp-symbol))


;;设置日历表的中文天干地支,在日期上按 `p C' 就可以显示农历和干支。
(setq chinese-calendar-celestial-stem ["甲" "乙" "丙" "丁" "戊" "已" "庚" "辛" "壬" "癸"])
(setq chinese-calendar-terrestrial-branch ["子" "丑" "寅" "卯" "辰" "巳" "午" "未" "申" "酉" "戌" "亥"])

;;设置你所在地方的经度纬度,在日历中就可以查看日出日落时间。
(setq calendar-latitude 30.15)
(setq calendar-longitude 120.10)
(setq calendar-location-name "Somewhere")

;;记住上次编辑的文件,这样你下次进入Emacs 的时候,就会直接打开
;;上次编辑的东西,就和没退出过一样。建议,把这个设置放在配置文件的最末尾!
(require 'desktop)
(desktop-save-mode t)
(desktop-read)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;; End of file!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 

本文地址:http://www.45fan.com/a/question/71123.html
Tags: 配置文件 Emacs .emacs
编辑:路饭网
关于我们 | 联系我们 | 友情链接 | 网站地图 | Sitemap | App | 返回顶部