Tanky WooRSS

我的.emacs配置文件

06 Nov 2011
这篇博客是从旧博客 WordPress 迁移过来,内容可能存在转换异常。

此文会随便我的.emacs文件保持最新更新:

最后更新:2011.11.6

关于:初步实现了一些大众功能,如行号,配色,以及一些mode-line附加功能,配置比较简单,但是基本折腾了大半天时间,不过在这个过程中也学到了很多,非常有乐趣,下一步将会正对具体的语言细节进行配置。

;;
;; Tanky Woo's .emacs
;; Date: 2011.11.6
;; Blog: www.WuTianQi.com
;;

;; setnu.el的启动
;; M-x setnu-mode
;; 没有linum.el好用,所以注视掉了~~
;; (require 'setnu)
;; (setnu-mode t)

;; linum.el的启动
;; M-x linum-mode
;; 启动自动显示行数
(require 'linum)
(setq linum-mode t)
(global-linum-mode 1)

;; 如果你要手工选背景色,可以使用
;; (set-background-color xxx)

;; color-theme.el
;; 配色
;; M-x color-theme-select
(add-to-list 'load-path "~/themes")
(require 'color-theme)
(setq color-theme-is-global t)
(color-theme-initialize)
(color-theme-tango)

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

;; 设置字体是Bitstream Vera Sans Moni
;; font-size是11,因为笔记本12寸,所以字体不敢弄太大
;; yum install bitstream-vera-sans-mono-fonts.noarch
(set-default-font "Bitstream Vera Sans Mono-11")

;; 支持emacs和外部程序的粘贴
(setq x-select-enable-clipboard t)

;; 在mode-line显示时间,格式如下
(display-time-mode 1)
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)

;; 以 y/n代表 yes/no
(fset 'yes-or-no-p 'y-or-n-p)

;; 实现全屏效果,快捷键为f6
(global-set-key [f6] 'my-fullscreen)
(defun my-fullscreen ()
(interactive)
(x-send-client-message
nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_FULLSCREEN" 0))
)

;; 最大化
(defun my-maximized ()
(interactive)
(x-send-client-message
nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
(x-send-client-message
nil 0 nil "_NET_WM_STATE" 32
'(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
)
;; 启动emacs时窗口最大化
(my-maximized)

;; Change the indentation level
(setq-default c-basic-offset 4)

;; Change the style
(setq c-default-style "linux"
          c-basic-offset 4)

(setq indent-tabs-mode nil)
(setq default-tab-width 4)
(setq tab-width 4)

;; 在标题栏提示你目前在什么位置
;; 这玩意也不知道干吗的?
;; (setq frame-title-format "TankyWoo@%b")

;; 去掉工具栏
;; (tool-bar-mode nil)

;;去掉菜单栏
;; (menu-bar-mode nil)

;; 去掉滚动栏
;; (scroll-bar-mode nil)

参考资料:

1.http://wiki.woodpecker.org.cn/moin/EmacsSuperEasyTutorial (强烈推荐!)

2.http://emacser.com/my-emacs-config.htm

3.http://emacser.com/torture-emacs.htm

4.http://www.cnblogs.com/chinazhangjie/archive/2011/06/01/2067263.html

5.http://www.linuxsir.org/bbs/showthread.php?t=112349

6.http://forum.ubuntu.org.cn/viewtopic.php?t=168366

7.http://i.linuxtoy.org/docs/guide/ch25s04.html#id3105915


其他一些相关链接:

1.http://emacser.com/non-programmer.htm

2.http://emacser.com/emacs-simple-use.htm

3.http://i.linuxtoy.org/docs/guide/ch25.html

4.http://minano-notebook.wikidot.com/emacs

5.http://emacser.com/page/7

6.http://emacser.com/color-theme.htm

7.http://longsy.iteye.com/blog/889162

8.http://lifegoo.pluskid.org/wiki/EmacsColorTheme.html#fn.1