|

楼主 |
发表于 2009-11-23 13:25:07
|
显示全部楼层
这个是我的配置文件内容,有点搞不懂的是为什么快捷键设置没有效果?- (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.
- '(column-number-mode t)
- '(display-time-mode t)
- '(scroll-bar-mode (quote right))
- '(show-paren-mode t)
- '(size-indication-mode t)
- '(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify))))
- ;; 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.
- '(display-time-mode nil)
- '(show-paren-mode t)
- ;;
- (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.
- )
- ;;
- ;;
- ;;
- ;;关于emacs yasnippet的配置,万能补全相关
- (add-to-list 'load-path "/usr/share/emacs/site-lisp/yas")
- (require 'yasnippet) ;; not yasnippet-bundle
- (yas/initialize)
- (yas/load-directory "/usr/share/emacs/site-lisp/yas/snippets")
- ;;end
- ;;关于CSCOPE的配置,查看代码相关
- (require 'xcscope)
- ;;end
- ;;ui设置, 设置tab宽度为4
- (setq c-basic-offset 4)
- (setq default-tab-width 4)
- (setq-default indent-tabs-mode nil)
- ;;end
- ;; 不产生备份文件
- (setq make-backup-files nil)
- ;;end
- ;; 保存上次的操作记录到SESSION: http://emacs-session.sourceforge.net/
- (require 'session)
- (add-hook 'after-init-hook 'session-initialize)
- (setq session-save-file "~/.emacs.d/session")
- ;;end
- ;; 代码折叠:
- ;; http://www.gnuvola.org/software/j/hideshow/
- (load-library "hideshow")
- (add-hook 'c-mode-hook 'hs-minor-mode)
- (add-hook 'c++-mode-hook 'hs-minor-mode)
- (add-hook 'java-mode-hook 'hs-minor-mode)
- (add-hook 'perl-mode-hook 'hs-minor-mode)
- (add-hook 'php-mode-hook 'hs-minor-mode)
- (add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)
- ;;end
- ;; 支持emacs和外部程序的粘贴
- (setq x-select-enable-clipboard t)
- ;;end
- ;;end
- ;; 颜色主题: http://download.gna.org/color-theme/
- (require 'color-theme)
- (color-theme-initialize)
- (color-theme-midnight)
- ;;end
- ;; 打开图片显示功能
- (auto-image-file-mode t)
- ;;end
- ;; c/c++ 设置
- (defun my-c-mode-hook()
- ;;设置编译命令为make
- (setq compile-command "make")
- ;;设置c/c++风格
- (c-set_style "stroustrup")
- (setq tab-width 4 indent-tabs-mode nil)
- ;;贪心删除
- (c-toggle-hungry-state 1)
- ;;ctrl+` 代码折叠
- (define-key c-mode-base-map [(control\`)] 'hs-toggle-hiding)
- ;; F5:编译
- (define-key c-mode-base-map (f5) 'compile)
- )
- (add-hook 'c-mode-hook 'my-c-mode-hook)
- (add-hook 'c++-mode-hook 'my-c-mode-hook)
- ;;end
- ;;快捷键设置
- ;; F1:最大化当前buffer:
- (global-set-key [(f1)] 'delete-other-windows)
- ;; F2:切换到dired模式
- (global-set-key [(f2)] 'dired)
- ;; F3:切换到shell模式
- (global-set-key [(f3)] 'ansi-term)
- ;; F4:关闭buffer
- (global-set-key [(f4)] 'kill-buffer-and-window)
- ;; F5:编译
- (global-set-key (kbd "<f5>") 'compile)
- ;; F6:跳到另一个窗口
- (global-set-key [(f6)] 'other-window)
- ;; F7:打开speedbar
- (global-set-key (kbd "<f7>") 'speedbar)
- ;; F9:GDB
- (global-set-key [(f9) 'gdb])
- ;; F10:GDB NEXT
- (global-set-key [(f10)] 'gud-next)
- ;; F11:GDB STEP
- (global-set-key [(f11)] 'gud-step)
复制代码 |
|