Wednesday, May 20, 2009

Add or eidt file: ".emacs"

(1)After install Emacs, you should create a ".emacs" file yourself, and save it in the path "home/user../"

(2)Install "speedbar" into Emacs

1. download speedbar package from http://packages.ubuntu.com/hardy/speedbar
2. save it in the path opt/speedbar/
3. sudo tar -xzf speedbar-0.14beta4.tar.gz
4. sudo make
Add following code in the file of ".emacs":
;;常用设置
;;(setq default-major-mode 'text-mode);一打开就起用 text 模式。
(global-font-lock-mode t);语法高亮
(auto-image-file-mode t);打开图片显示功能;;
(fset 'yes-or-no-p 'y-or-n-p);以 y/n代表 yes/no,可能你觉得不需要,呵呵。
(column-number-mode t);显示列号
(show-paren-mode t);显示括号匹配
(display-time-mode 1);显示时间,格式如下
(setq display-time-24hr-format t)
(setq display-time-day-and-date t);;
(tool-bar-mode nil);去掉那个大大的工具栏;;
(scroll-bar-mode nil);去掉滚动条,因为可以使用鼠标滚轮了 ^_^
(mouse-avoidance-mode 'animate);光标靠近鼠标指针时,让鼠标指针自动让开,别挡住视线。很好玩阿,这个功能
(setq mouse-yank-at-point t);支持中键粘贴
(transient-mark-mode t);这个忘了,郁闷!
(setq x-select-enable-clipboard t);支持emacs和外部程序的粘贴
(setq frame-title-format "xxx@%b");在标题栏提示你目前在什么位置。你要把xxx改成自己的用户名;;
(setq default-fill-column 80);默认显示 80列就换行

;;color Themes
(load-file "/home/xxx/myemacs/color-theme.el")
(color-theme-deep-blue);选择 deepblue的配色方案

;;speed Themes
~$ cat .emacs
(add-to-list 'load-path "/opt/speedbar/speedbar-0.14beta4")
(autoload 'speedbar-frame-mode "speedbar" "Popup a speedbar frame" t)
(autoload 'speedbar-get-focus "speedbar" "Jump to speedbar frame" t)
(define-key-after (lookup-key global-map [menu-bar tools]) [speedbar] '("Speedbar" . speedbar-frame-mode) [calendar])
;; Texinfo fancy chapter tags
(add-hook 'texinfo-mode-hook (lambda () (require 'sb-texinfo)))
;; HTML fancy chapter tags
(add-hook 'html-mode-hook (lambda () (require 'sb-html)))
;; For any verison of emacs on a linux RPM based system:
;; (autoload 'rpm "sb-rpm" "Rpm package listing in speedbar.")
;; For any version of emacs where w3 is installed:
;; w3 link listings (autoload 'w3-speedbar-buttons "sb-w3" "s3 specific speedbar button generator.")

No comments:

Post a Comment