我的emacs配置

.emacs文件

--------------------------------------------------------------------------------

(add-to-list 'load-path "~/.emacs.d")
(add-to-list 'load-path "~/.emacs.d/ecb-2.40")
(add-to-list 'load-path "~/.emacs.d/auto-complete")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-complete/ac-dict")
(ac-config-default)
(load "my_emacs_conf_1.el")
(load "my_emacs_cedet.el")
(load "my_emacs_ecb.el")
(load "my_emacs_auto_complete.el")

========================================================


.emacs.d目录下


my_emacs_auto_complete.el文件

;;auto_complete的配置文件,该插件的只需放到.emacs.d目录下即可

--------------------------------------------------------------------------

;; auto-complete key bindings
(global-set-key [(control tab)] 'auto-complete)

=============================================================

my_emacs_cedet.el文件

;;cedet的安装按官方网站上的就可以了,可以在windows上安装

-----------------------------------------------------

(load-file "~/.emacs.d/cedet-1.0.1/common/cedet.el")
;设置工作目录
(setq semanticdb-project-roots
      (list
      (expand-file-name "~/work")))
(require 'semanticdb)
(setq semanticdb-default-save-directory
(expand-file-name "~/.semanticdb"))

; Enable the Project management system
(global-ede-mode t)
(global-set-key [(f4)] 'speedbar-get-focus)
; Enable prototype help and smart completion  
(semantic-load-enable-code-helpers)    
; Enable template insertion menu
(global-srecode-minor-mode 1)           
(defun my-c-mode-cedet-hook ()
  (local-set-key "." 'semantic-complete-self-insert)
  (local-set-key ">" 'semantic-complete-self-insert))
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook)
;菜单自动提示
(global-set-key [(meta ?/)] 'semantic-ia-complete-symbol-menu)
;代码跳转
(global-set-key [f12] 'semantic-ia-fast-jump)
;代码折叠
(global-semantic-tag-folding-mode 1)
(define-key semantic-tag-folding-mode-map (kbd "C--") 'semantic-tag-folding-fold-block)
(define-key semantic-tag-folding-mode-map (kbd "C-=") 'semantic-tag-folding-show-block)

==============================================================================

my_emacs_conf_1.el文件

---------------------------------------------------------------------------------

;;显示行号
(require 'linum)
(global-linum-mode t)
;;不要生成临时文件  
(setq-default make-backup-files nil)
;;禁用启动信息  
(setq inhibit-startup-message t)
;;去掉菜单栏,否则alt键会冲突
;(menu-bar-mode nil)

(add-hook 'c-mode-hook 'linux-c-mode)
(add-hook 'java-mode-hook 'linux-c-mode)
(defun linux-c-mode()
;; 将回车代替C-j的功能,换行的同时对齐
(define-key c-mode-map [return] 'newline-and-indent)
(interactive)
;; 设置C程序的对齐风格
(c-set-style "K&R")
;; 自动模式,在此种模式下当你键入{时,会自动根据你设置的对齐风格对齐
(c-toggle-auto-state)
)

;;多个窗口间移动,S-方向键
(windmove-default-keybindings)

==============================================================================

my_emacs_ecb.el文件

;;ecb直接复制到.emacs.d

-----------------------------------------------------------------

(require 'ecb)
(require 'ecb-autoloads)
;;不要每日提示
(setq ecb-tip-of-the-day nil)
;;版本检测
(setq ecb-version-check nil)
;; 激活
(global-set-key [(f2)] 'ecb-activate)
;; 禁止
(global-set-key [(f3)] 'ecb-deactivate)
;;窗口移动
(global-set-key [M-left] 'windmove-left)
(global-set-key [M-right] 'windmove-right)
(global-set-key [M-up] 'windmove-up)
(global-set-key [M-down] 'windmove-down)
;;软件自己添加
(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"))
(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.
 )

=====================================================



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值