;;所有的插件都解压到~/.emacs.d目录下 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;基本配置;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (add-to-list 'load-path "~/.emacs.d") ;;显示行号 (require 'linum) (global-linum-mode t) ;;不要生成临时文件 (setq-default make-backup-files nil) ;;禁用启动信息 (setq inhibit-startup-message t) ;;括号的自动补全 (defun my-mode-auto-pair () (interactive) (make-local-variable 'skeleton-pair-alist) (setq skeleton-pair-alist '( (?\" _ "\"") (?' _ "'") (?\( _ ")") (?\[ _ "]") ;;(?\{ _ "}") (?{ \n > _ \n ?} >))) ;;>为tab键,捕获{后插入\n ,tab 自动补全\n, }, tab (setq skeleton-pair t) (local-set-key (kbd "(") 'skeleton-pair-insert-maybe) (local-set-key (kbd "{") 'skeleton-pair-insert-maybe) (local-set-key (kbd "'") 'skeleton-pair-insert-maybe) (local-set-key (kbd "\"") 'skeleton-pair-insert-maybe) (local-set-key (kbd "[") 'skeleton-pair-insert-maybe)) (add-hook 'c-mode-hook 'my-mode-auto-pair) (add-hook 'c++-mode-hook 'my-mode-auto-pair) (add-hook 'java-mode-hook 'my-mode-auto-pair) ;;(add-hook 'c-mode-common-hook 'my-mode-auto-pair) ;;软件自己添加 (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. ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cedet2.40的配置;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;cedet的安装见官方网站,解压后,编译下即可,其它插件,如没说明直接解压 (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) ;;;;;;;;;;;;;;;;;;;;;;ecb的配置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "~/.emacs.d/ecb-2.40") (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) ;;;;;;;;;;;;;;;;;;;;;;auto-complete的配置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (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) ;; auto-complete key bindings (global-set-key [(control tab)] 'auto-complete) ;;;;;;;;;;;;;;;;;;;;;;;;color-theme配置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0") (require 'color-theme) (color-theme-initialize) ;;颜色比较难看,就不配置了 ;;(load "my_emacs_conf_1.el") ;;(load "my_emacs_cedet.el") ;;(load "my_emacs_ecb.el") ;;(load "my_emacs_auto_complete.el")
emacs单文件不断修改版
最新推荐文章于 2024-08-30 16:00:44 发布