emacs的经常使用配置备份

听说有人搞丢了本身的emacs的配置,而后一怒之下抛弃了emacs投身vim,我仍是作个emacs配置的备份吧,html

虽然我如今也算不上emacs的发烧友。shell

这里的配置大可能是从网上参考的,最多的是下面的连接:vim

http://blog.chinaunix.net/uid-25830557-id-317944.htmlbash

;;一下为正文配置

(set-keyboard-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-selection-coding-system 'utf-8)
(modify-coding-system-alist 'process "*" 'utf-8)
(setq default-process-coding-system '(utf-8 . utf-8))
(setq-default pathname-coding-system 'utf-8)
(set-file-name-coding-system 'utf-8)
(setq ansi-color-for-comint-mode t)
;;处理shell-mode乱码,好像没做用

 ;; 隐藏滚动栏和菜单,最好用下面三条

(tool-bar-mode 0)

(menu-bar-mode 0)

(scroll-bar-mode 0)

(set-scroll-bar-mode nil)
;;取消滚动栏

;;(customize-set-variable 'scroll-bar-mode 'right))
;;设置滚动栏在窗口右侧,而默认是在左侧

(tool-bar-mode nil)
;;取消工具栏

 

(setq visible-bell t)
;;关闭烦人的出错时的提示声

(setq inhibit-startup-message t)
;;关闭emacs启动时的画面

(setq gnus-inhibit-startup-message t)
;;关闭gnus启动时的画面

(fset 'yes-or-no-p 'y-or-n-p)
;; 改变 Emacs 执拗的要你回答 yes 的行为。按 y 或空格键表示 yes,n 表示 no。

 

(setq column-number-mode t)
(setq line-number-mode t)
;;显示行列号
;;(global-linum-mode t)
(setq mouse-yank-at-point t)
;;不要在鼠标点击的那个地方插入剪贴板内容。我不喜欢那样,常常把个人文档搞的一团糟。我以为先用光标定位,而后鼠标中键点击要好的多。无论你的光标在文档的那个位置,或是在 minibuffer,鼠标中键一点击,X selection 的内容就被插入到那个位置。

(setq kill-ring-max 200)
;;设置粘贴缓冲条目数量.用一个很大的kill ring(最多的记录个数). 这样防止我不当心删掉重要的东西

(setq-default indent-tabs-mode nil)
(setq default-tab-width 8);;tab键为8个字符宽度
(setq tab-stop-list ())
;;不用 TAB 字符来indent, 这会引发不少奇怪的错误。编辑 Makefile 的时候也不用担忧,由于 makefile-mode 会把 TAB 键设置成真正的 TAB 字符,而且加亮显示的。

(setq scroll-margin 3 scroll-conservatively 10000)
;;防止页面滚动时跳动, scroll-margin 3 能够在靠近屏幕边沿3行时就开始滚动,能够很好的看到上下文。

(setq default-major-mode 'text-mode)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
;;设置缺省主模式是text,,并进入auto-fill次模式.而不是基本模式fundamental-mode

(show-paren-mode t)
;;打开括号匹配显示模式

(setq show-paren-style 'parenthesis)
;;括号匹配时能够高亮显示另一边的括号,但光标不会烦人的跳到另外一个括号处。

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

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

 

(setq global-font-lock-mode t)
;;进行语法加亮。

(setq-default kill-whole-line t)
;; 在行首 C-k 时,同时删除该行。

 

(setq make-backup-files nil)
;; 设定不产生备份文件

;;(setq auto-save-mode nil)
;;自动保存模式

(setq-default make-backup-files nil)
;; 不生成临时文件

;;容许emacs和外部其余程序的粘贴
(setq x-select-enable-clipboard t)

;;(setq mouse-yank-at-point t)
;;使用鼠标中键能够粘贴

(setq require-final-newline t)
;; 自动的在文件末增长一新行

(setq-default transient-mark-mode t)
;;Non-nil if Transient-Mark mode is enabled.

(setq track-eol t)
;; 当光标在行尾上下移动的时候,始终保持在行尾。

;;c语言缩进
(setq default-tab-width 4)
(setq-default indent-tabs-mode nil)
(setq c-default-style "Linux")
(setq c-basic-offset 4)
;;到底以后的警告, 不设置的话putty可能会闪烁

(setq ring-bell-function 'ignore)
相关文章
相关标签/搜索