我的Emacs配置文件

;;用户根目录下,文件名:~/.emacs


;;设置中文显示

(set-language-environment 'Chinese-GB)
(set-keyboard-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(set-clipboard-coding-system 'cn-gb-2312)
(set-terminal-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(set-selection-coding-system 'cn-gb-2312)
(set-default-coding-systems 'utf-8)
(setq locale-coding-system 'utf-8)
(modify-coding-system-alist 'process "*" 'utf-8)
(setq default-process-coding-system 'utf-8)
(setq default-pathname-coding-system 'utf-8)

;;其它设置
(setq default-major-mode 'text-mode) ;;默认启用text模式
(auto-image-file-mode t) ;;打开图片显示功能
(global-font-lock-mode t) ;;语法高亮
(show-paren-mode t) ;;显示括号匹配
(setq line-number-mode t) ;;显示行号
(setq column-number-mode t) ;;显示列号
(setq default-fill-column 800) ;;默认显示80列就换行
(display-time-mode 1) ;;显示时间,格式如下
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(tool-bar-mode nil) ;;去掉工具栏
(menu-bar-mode nil) ;;去掉工具栏
;;(scroll-bar-mode nil) ;;去掉滚动条
(fset 'yes-or-no-p 'y-or-n-p) ;;以y/n代替yes/no
(mouse-avoidance-mode  'animate) ;;光标靠近鼠标指针时,让鼠标指针自动让开,别挡住视线
(setq mouse-yank-at-point t) ;;支持中间粘贴
(setq x-select-enable-clipboard t) ;;支持emacs和外部程序的粘贴

(setq frame-title-format "root@%b");;在标题栏提示你目前在什么位置

;;设置默认tab宽度为4

(setq tab-width 4

indent-tabs-mode t

c-basic-offset 4)


;;==================================================================
;;加载插件
(load-file "~/bin/cedet-1.0.1/common/cedet.el")
(add-to-list 'load-path "~/tmp/ecb-2.40")

(require 'cc-mode)
(require 'ecb)

(load-file "~/bin/cscope-15.7a/contrib/xcscope/xcscope.el")
(require 'xcscope)

;;==================================================================
;;C++设置
;;设置semanticdb代码搜索路径
(setq semanticdb-project-roots
  (list
    (expand-file-name "~/workspace/code/")
  )
)

(defun my-cedet-hook()
  (local-set-key [(f1)] 'semantic-ia-fast-jump)
  (local-set-key [(f2)] 'semantic-symref-symbol) ;;查找变量调用的地方
  (local-set-key [(f3)] 'semantic-symref) ;;查找函数调用的地方
  (local-set-key [(f4)] 'semantic-ia-complete-symbol-menu)
  ;;(local-set-key [(control tab)] 'semantic-ia-complete-symbol)
  ;;(local-set-key "." 'semantic-complete-self-insert)
  ;;(local-set-key ">" 'semantic-complete-self-insert)
  ;;(local-set-key "\C-co" 'semantic-complete-analyze-inline)
  ;;(local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle)
  ;;(local-set-key "\C-cl" 'senator-completion-menu-popup)
)
(add-hook 'c-mode-common-hook 'my-cedet-hook)

;;hippie 自动补齐
(autoload 'senator-try-expand-semantic "senator")
(setq hippie-expand-try-functions-list
  '(senator-try-expand-semantic
    try-expand-dabbrev
    try-expand-dabbrev-visible
    try-expand-dabbrev-all-buffers
    try-expand-dabbrev-from-kill
    try-expand-dabbrev-list
    try-expand-list-all-buffers
    try-expand-line
    try-expand-line-all-buffers
    try-complete-file-name-partially
    try-complete-file-name
    try-expand-whole-kill
    try-expand-all-abbrevs
    try-expand-list
    try-expand-line
    try-complete-lisp-symbol-partially
    try-complete-lisp-symbol
  )
)

;;(setq gdb-many-windows t)

;;显示speedbar
;;(golbal-set-key [(f4)] 'speedbar-get-focus)

;;==================================================================
;;ecb初始设置
(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.
 '(ecb-options-version "2.40")
 '(ecb-source-path (quote ("/home/songjun/tmp/ecb-2.40/info-help/ ~/liangshan/trunk"))))
(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.
)
;;自动启动ecb,并且不显示每日提示
(setq ecb-auto-activate t
  ecb-tip-of-the-day nil)
;;ecb各窗口间切换
(global-set-key "\C-c1" 'windmove-left)
(global-set-key "\C-c2" 'windmove-right)
(global-set-key "\C-c3" 'windmove-up)
(global-set-key "\C-c4" 'windmove-down)
;;隐藏和显示ecb窗口
;;(define-key global-map [()] 'ecb-hide-ecb-windows)
;;(define-key global-map [()] 'ecb-show-ecb-windows)
;;使某一ecb窗口最大化
;;(define-key global-map "" 'ecb-maximize-window-directories)
;;(define-key global-map "" 'ecb-maximize-window-sources)
;;(define-key global-map "" 'ecb-maximize-window-methods)
;;(define-key global-map "" 'ecb-maximize-window-history)
;;恢复原始窗口布局
;;(define-key global-map "" 'ecb-restore-default-window-sizes)
;;激活和取消
;;(global-set-key [f12] 'ecb-activate)
;;(global-set-key [C-f12] 'ecb-deactivate)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值