每次重装emacs,都要重写其”.emacs“,还有一大堆东西,总忘,索性,写下来:
Date:2012.04.06
我的emacs配置文件为:(这是win7的,所以,在linux下要适当的改一下)
----------------------------------------------------------------------------------------------------------------
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(menu-bar-mode nil)
'(scroll-bar-mode nil)
'(tool-bar-mode nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "SystemWindow" :foreground "SystemWindowText" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight bold :height 120 :width normal :foundry "outline" :family "Courier New")))))
;;;;Text mode and Auto Fill mode
;The date is 2011.12.16
;This function is for writer who wants start writing prose rather than code
;but when emacs recongise the type of the file will start for that type
(setq default-major-mode 'text-mode)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
;;;;Rebind 'C-x C-b'for 'buffer-menu'
;The date is 2011.12.16
;Before my changing it ,this key is for 'list-buffer'
(global-set-key "\C-x\C-b" 'buffer-menu)
;;;;Emacs Load Path
;The date is 2011.12.16
;I don't know wheter this path setting is right in windows 7
(setq load-path (cons "E:/emacs" load-path))
;;;;Compare windows
;The date is 2011.12.16
;This function can compare two windows to find the same line
(global-set-key "\C-cw" 'compare-windows)
;;;;Php-mode
;The date is 2011.12.16
;add the extend dir into load-path
(add-to-list 'load-path "E:/emacs/emacsextend/php-mode-1.5.0")
;open php-mode
(require 'php-mode)
(add-hook 'php-mode-user-hook 'turn-on-font-lock)
;;;;Line number
;The date is 2011.12.16
(global-linum-mode t)
;;;;Full screen
;The date is 2011.12.16
;F11 to open full screen mode
;(defun fullscreen()(interactive)(set-frame-parameter nil'fullscreen(if(frame-parameter nil 'fullscreen)nil 'fullboth)))
;;;;Nxhtml mode
;The date is 2012.01.04
;this mode can mix the html ,php,javascript,css and so on
(load "e:/emacs/emacsextend/nxhtml/autostart.el")
;;;;Color-theme-6.6.0
;The date is 2012.01.04
;this is a color theme library
(add-to-list'load-path "e:/emacs/emacsextend/color-theme-6.6.0")
(require 'color-theme)
(color-theme-initialize)
(color-theme-comidia)
当然了,这些是最基础的,更深的有待学习,所以此Blog有待续写..........................................
--------------------------------------------------------------------------------------------------------------------------
The date is 2012.08.01
custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(menu-bar-mode nil)
'(scroll-bar-mode nil)
'(tool-bar-mode nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "SystemWindow" :foreground "SystemWindowText" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight bold :height 120 :width normal :foundry "outline" :family "Courier New")))))
;;;;MyEmacs
;This is Peter's Emacs
;The date is 2012.07.04
;;;;Text mode and Auto Fill mode
;The date is 2011.12.16
;This function is for writer who wants start writing prose rather than code
;but when emacs recongise the type of the file will start for that type
(setq default-major-mode 'text-mode)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
;;;;Rebind 'C-x C-b'for 'buffer-menu'
;The date is 2011.12.16
;Before my changing it ,this key is for 'list-buffer'
(global-set-key "\C-x\C-b" 'buffer-menu)
;;;;Emacs Load Path
;The date is 2011.12.16
;I don't know wheter this path setting is right in windows 7
(setq load-path (cons "D:/MySoftware/Software-Two/Emacs/emacs-23.3" load-path))
;;;;Compare windows
;The date is 2011.12.16
;This function can compare two windows to find the same line
(global-set-key "\C-cw" 'compare-windows)
;;;;Line number
;The date is 2011.12.16
(global-linum-mode t)
;;;;Full screen
;The date is 2011.12.16
;F11 to open full screen mode
;(defun fullscreen()(interactive)(set-frame-parameter nil'fullscreen(if(frame-parameter nil 'fullscreen)nil 'fullboth)))
;;;;Color-theme-6.6.0
;The date is 2012.01.04
;this is a color theme library
(add-to-list'load-path "D:/MySoftware/Software-Two/Emacs/emacsextend/color-theme-6.6.0")
(require 'color-theme)
(color-theme-initialize)
(color-theme-comidia)
;;;;Match parentheses
;;date is 2012.07.04
;; enable skeleton-pair insert globally
(setq skeleton-pair t)
(global-set-key (kbd "(") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "[") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "{") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "\"") 'skeleton-pair-insert-maybe)
;;;;Highlight parentheses
;;date is 2012.07.04
;;This setting is for highlighting the parentheses
(show-paren-mode 't)
;;;;Auto-TAB
;;date is 2010.07.05
;;This setting is for auto-tab
(global-set-key (kbd "RET") 'newline-and-indent)
;;;;Indent line
;;date is 2012.07.10
;;This setting is for indent line
(add-to-list 'load-path "D:/MySoftware/Software-Two/Emacs/emacsextend/indent-line")
(require 'aux-line)
;;;;Bind the '-' to <C-tab>
;;The date is 2012.07.30
;;Aftering binding the '-' to <C-tab>, it is convenient to type '-'
(fset 'subtraction-sign "-")
(global-set-key (kbd "<C-tab>") 'subtraction-sign)
;;;;Set "-" to J+Space
;;The date is 2012.08.01
;;If press J+Space, it generates the "-"
(add-to-list 'load-path "D:/MySoftware/Software-Two/Emacs/emacsextend/key-chord")
(require 'key-chord)
(key-chord-mode 1)
(key-chord-define-global "j " (lambda() (interactive) (insert "-")))
--------------------------------------------------------------------------------------------------------------------------