fstab配置文件
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/hdd7
UUID=21f3713a-8e4b-4b15-b612-4df7e86d26fd / ext3 defaults,errors=remount-ro 0 1
# /dev/hdd8
UUID=d490dddb-57ec-41e1-a0be-cbc4f1200b12 none swap sw 0 0
/dev/hda /media/cdrom0 iocharset=utf8,udf,iso9660 user,noauto 0 0
/dev/ /media/floppy0 auto rw,user,noauto 0 0
/dev/hdd1 /mnt/winC ntfs-3g silent,umask=0,locale=zh_CN.utf8 0 0
/dev/hdd5 /mnt/winD vfat iocharset=utf8,umask=000 0 0
;;----------------------------------------------------------------------------
;;~/.emacs的内容
;;----------------------------------------------------------------------------
;;全局的快捷键
(global-set-key [(f3)] 'speedbar);;F3打开speedbar
(global-set-key [(f4)] 'eshell);;;F4:切换到shell模式
(global-set-key [f12] 'ecb-activate) ;;定义F12键为激活ecb
(global-set-key [C-f12] 'ecb-deactivate) ;;定义Ctrl+F12为停止ecb
(global-set-key (kbd "M-s") 'speedbar-get-focus);Alt+s让speedbar获得焦点
(global-set-key "\C-x\C-m" 'buffer-menu-other-window);; 多开一个窗口显示已已打开的缓冲区列表
(global-set-key (kbd "<home>") 'beginning-of-line)
(global-set-key (kbd "<end>") 'end-of-line)
(global-set-key (kbd "C-<home>") 'beginning-of-buffer)
(global-set-key (kbd "C-<end>") 'end-of-buffer)
;;----------------------------------------------------------------------------
;; 设置字体
(create-fontset-from-fontset-spec
"-*-courier-medium-r-*-*-17-*-*-*-*-*-fontset-song,\
chinese-gb2312:-wenquanyi-wenquanyi bitmap song-medium-r-*-*-*-*-*-*-*-*-iso10646-1,\
chinese-gbk:-wenquanyi-wenquanyi bitmap song-medium-r-*-*-*-*-*-*-*-*-iso10646-1,\
chinese-gb18030:-wenquanyi-wenquanyi bitmap song-medium-r-*-*-*-*-*-*-*-*-iso10646-1,\
chinese-cns11643-5:-wenquanyi-wenquanyi bitmap song-medium-r-*-*-*-*-*-*-*-*-iso10646-1,\
chinese-cns11643-6:-wenquanyi-wenquanyi bitmap song-medium-r-*-*-*-*-*-*-*-*-iso10646-1,\
chinese-cns11643-7:-wenquanyi-wenquanyi bitmap song-medium-r-*-*-*-*-*-*-*-*-iso10646-1")
(set-default-font "fontset-song")
(add-to-list 'after-make-frame-functions
(lambda (new-frame) (select-frame new-frame)
(set-default-font "fontset-song")))
;;----------------------------------------------------------------------------
;;界面颜色主题 color-theme
;;下载网址:http://www.linuxfans.org/nuke/modules/Forums/files/color-theme.el.tar.bz2
(load-file "~/myEmacs/color-theme.el")
(require 'color-theme)
(color-theme-dark-blue)
;;(set-face-background 'default "LightCyan3") ;;设置背景色为 浅青色3
;;----------------------------------------------------------------------------
(setq visible-bell t) ;;关闭烦人的出错时的提示声
(display-time-mode 1);显示时间,格式如下
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(global-font-lock-mode t);语法高亮
(show-paren-mode t);显示括号匹配
(setq column-number-mode t) ;显示列号
(fset 'yes-or-no-p 'y-or-n-p);;
(setq inhibit-startup-message t);; disable the welcome screen
(setq gnus-inhibit-startup-message t);;去掉gnus启动时的引导界面
(setq default-fill-column 80) ;;for my wide screen
;; 让sentence-end可以识别全角的标点符号
(setq sentence-end "\\([。!?]\\|……\\|[.?!][]\"')}]*\\($\\|[ \t]\\)\\)[ \t\n]*")
(setq sentence-end-double-space nil)
(transient-mark-mode t);;高亮显示要拷贝的区域
(tool-bar-mode -1);;调整工具条的模式
;;----------------------------------------------------------------------------
;; 默认进入auto-fill模式
(setq default-major-mode 'text-mode)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(setq frame-title-format "Emacs_filebat@%b")
;;(tool-bar-mode nil) ; no tool bar
(setq inhibit-startup-message t)
(setq cursor-in-non-selected-windows nil)
(setq default-cursor-type 'bar)
(set-scroll-bar-mode 'right) ;;滚动条设在右侧
(show-paren-mode t)
(setq show-paren-style 'parentheses)
;;----------------------------------------------------------------------------
(setq frame-title-format "filebat-%b");在标题栏提示你目前在什么位置
;; 设置地理位置
(setq calendar-latitude 39.90)
(setq calendar-longitude 116.30)
(setq calendar-location-name "Beijing")
;; 在日历中使用天干地支
(setq chinese-calendar-celestial-stem
["甲" "乙" "丙" "丁" "戊" "己" "庚" "辛" "壬" "癸"])
(setq chinese-calendar-terrestrial-branch
["子" "丑" "寅" "卯" "辰" "巳" "戊" "未" "申" "酉" "戌" "亥"])
;;----------------------------------------------------------------------------
;; 代码折叠
(require 'hideshow)
(add-hook 'c++-mode-hook 'hs-minor-mode)
;;----------------------------------------------------------------------------
;; CC-mode配置 http://cc-mode.sourceforge.net/
(require 'cc-mode)
(c-set-offset 'inline-open 0)
(c-set-offset 'friend '-)
(c-set-offset 'substatement-open 0)
;;C/C++语言编辑策略
(defun my-c-mode-common-hook()
(setq tab-width 4 indent-tabs-mode nil)
(c-set-style "stroustrup")
;;; hungry-delete and auto-newline
(c-toggle-auto-hungry-state 1)
;;按键定义
(define-key c-mode-base-map [(control \`)] 'hs-toggle-hiding)
(define-key c-mode-base-map [(return)] 'newline-and-indent)
(define-key c-mode-base-map [(f5)] 'compile)
(define-key c-mode-base-map [C-f5] 'compile);;运行编译命令
(setq-default compile-command "make") ;;编译时,使用make而不是默认的make -k
(define-key c-mode-base-map [(meta \`)] 'c-indent-command)
;; (define-key c-mode-base-map [(tab)] 'hippie-expand)
(define-key c-mode-base-map [(meta ?/)] 'semantic-ia-complete-symbol-menu)
;;预处理设置
(setq c-macro-shrink-window-flag t)
(setq c-macro-preprocessor "cpp")
(setq c-macro-cppflags " ")
(setq c-macro-prompt-flag t)
(setq abbrev-mode t)
)
;;设定编译命令
(defun du-onekey-compile ()
"Save buffers and start compile"
(interactive)
(save-some-buffers t)
(compile compile-command))
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
;;----------------------------------------------------------------
;;设置代码样式
;; coding style
(add-hook 'c-mode-hook
'(lambda ()
(c-set-style "stroustrup")
(imenu-add-menubar-index)))
;; (c-toggle-auto-state)))
(add-hook 'c++-mode-hook
'(lambda ()
(c-set-style "stroustrup")
(imenu-add-menubar-index)))
;; (c-toggle-auto-state)))
;;----------------------------------------------------------------------------
(load-file "~/myEmacs/tabbar.el")
;;相关网址http://learn.tsinghua.edu.cn/homepage/2001315450/emacs_elisp.html
(require 'tabbar)
(tabbar-mode)
;;----------------------------------------------------------------------------
(setq x-select-enable-clipboard t) ;支持emacs和外部程序的粘贴
;;----------------------------------------------------------------------------
(load-file "~/myEmacs/template.el")
(require 'template)
(template-initialize)
;;----------------------------------------------------------------------------

Leave a comment