文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>我的Emacs配置文件

我的Emacs配置文件

时间:2007-07-05  来源:rockylinux

安装了emacs23.0,把以前的配置文件copy过来

;(setq visible-bell t);关闭出错提示声
(setq inhibit-startup-message t);关闭开启画面
(setq column-number-mode t);
;------------------------------- 设置界面-------------------------------
(set-cursor-color "Wheat")
(set-mouse-color "Wheat")
(set-foreground-color "Wheat")
(set-background-color "DarkSlateGray")
(if window-system
      (setq default-frame-alist
                 (append
                     '( (top . 80)
                             (left . 100)                               
                                 (width . 110)
                                 (height . 35))
                                      default-frame-alist))
)
;-----------------------------end of 设置界面--------------------------

;------------------------------- 设置显示时间---------------------------
(display-time-mode 1)
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
;--------------------------------endof 设置显示时间---------------------

;-------------------------------快捷键---------------------------------
; (define-key  [(f7)] 'compile)
;;;;以下是我的快捷键设置

(global-set-key [(meta g)] 'goto-line)
;;(global-set-key [(meta ?/)] 'hippie-expand)

;; F12 t 从当前缓冲区建立任务
(global-set-key (kbd "<f12> t") 'planner-create-task-from-buffer)
;; F12 g 切换到当日的任务
;;(global-set-key (kbd "<f12> g") 'planner-goto-today)
(global-set-key (kbd "<f12> g") 'planner-goto-today)
(global-set-key (kbd "<f12> p") 'plan)
;; F12 r 添加当前备忘录
(global-set-key (kbd "<f12> r") 'remember)
;; F12 c 切换到日历
(global-set-key (kbd "<f12> c") 'calendar)

;;;F2:进入wiki-mode模式
(global-set-key [(f2)] 'emacs-wiki-find-file)

;;;F3:切换到dired模式
(global-set-key [(f3)] 'dired)

;;;F4:切换到shell模式
(global-set-key [(f4)] 'ansi-term)

;;;F5:打开speedbar
(global-set-key [(f5)] 'speedbar)

;;;;F7:调用compile
(global-set-key (kbd "<f7>") 'compile)

;;;Alt+s : 让speedbar获得焦点
(global-set-key (kbd "M-s") 'speedbar-get-focus)

;;;F9:列举我的书签
(global-set-key (kbd "<f9>") 'list-bookmarks)

;;;F10:添加当前页到书签中
(global-set-key [(f10)] 'bookmark-set)

;;;F12 u 更新当前版本
(global-set-key (kbd "<f12> u") 'vc-next-action)

;;------------------------End of 快捷键 ---------------------

;(setq kill-ring-max 200);; 设置粘贴缓冲条目数量
(setq enable-recursive-minibuffers t);; 设置递归使用minibuffer
;;(setq scroll-margin 3
;;      scroll-conservatively 10000) ;;防止页面滚动时跳动
(setq default-major-mode 'text-mode);;设置默认模式是text mode
(show-paren-mode t)
(setq show-paren-style 'parentheses) ;; 设置显示括号匹配,但不跳转
(mouse-avoidance-mode 'animate) ;;让鼠标不要挡住光标

;------------------------------程序语言--------------------------------
;;;; 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)

;;;;根据后缀判断所用的mode
;;;;注意:我在这里把.h关联到了c++-mode
(setq auto-mode-alist
      (append '(("\\.h$" . c++-mode)) auto-mode-alist))

;;;;我的C/C++语言编辑策略

(defun my-c-mode-common-hook()
  (setq tab-width 4 indent-tabs-mode nil)
  ;;; 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 [(f7)] 'compile)
  (define-key c-mode-base-map [(f8)] 'ff-get-other-file)
  (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 [(tab)] 'my-indent-or-complete)
  (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 hs-minor-mode t)
  (setq abbrev-mode t)
  (setq tab-width 4 indent-tabs-mode nil)
)
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

;;;;我的C++语言编辑策略
(defun my-c++-mode-hook()
  (setq tab-width 4 indent-tabs-mode nil)
  (c-set-style "stroustrup")
;;  (define-key c++-mode-map [f3] 'replace-regexp)
)

(add-hook 'c++-mode-hook 'my-c++-mode-hook)

;;;;C/C++语言启动时自动加载semantic对/usr/include的索引数据库
(setq semanticdb-search-system-databases t)
  (add-hook 'c-mode-common-hook
          (lambda ()
            (setq semanticdb-project-system-databases
                  (list (semanticdb-create-database
                           semanticdb-new-database-class
                           "/usr/include")))))
;;;;我的Java语言编辑策略
(defun my-java-mode-hook()
  (setq tab-width 4 indent-tabs-mode nil)
)

(add-hook 'java-mode-hook 'my-java-mode-hook)

;;;; Python Mode设置
;(add-to-list 'load-path "/home/caole/lib/emacs-lisp/python-mode-1.0")
;(require 'python-mode)
;;(require 'pycomplete)
;(require 'doctest-mode)

;;;; 注释配置
;(load-file "/home/caole/lib/emacs-lisp/gnome-doc.el")

;----------------------end of 程序语言---------------------------------

相关阅读 更多 +
排行榜 更多 +
一剑灭天

一剑灭天

角色扮演 下载
戮仙战纪

戮仙战纪

角色扮演 下载
头号海贼王手机版

头号海贼王手机版

棋牌卡牌 下载