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)
相關文章
相關標籤/搜索