;;设置加载路径================================================================================ (setq home-path "D://Program Files//emacs-23.1-bin-i386//") (setq load-path (cons home-path load-path)) (add-to-list 'load-path (concat home-path "yasnippet")) (add-to-list 'load-path (concat home-path "company-0.5")) ;;=========================================================================================== ;;加载插件=================================================================================== (require 'color-theme) (color-theme-deep-blue) (autoload 'company-mode "company" nil t) (setq company-idle-delay t) (require 'yasnippet-bundle) ;;========================================================================================== ;;加载tags (setq tags-file-name ".//TAGS") ;;将*.py和python-mode联系起来 (setq auto-mode-alist (cons '("//.py$". python-mode) auto-mode-alist)) (setq interpreter-mode-alist (cons '("python". python-mode) interpreter-mode-alist)) (autoload 'python-mode "python-mode" "Python editing mode." t) ;;打开iswitch (iswitchb-mode 1) ;;打开hs-minor-mode (setq hs-allow-nesting t) (add-hook 'c-mode-common-hook (lambda () (hs-minor-mode 1) )) (add-hook 'emacs-lisp-mode-hook (lambda() (hs-minor-mode 1))) (add-hook 'tcl-mode-hook (lambda () (hs-minor-mode 1) )) ;;设置字体 (set-default-font "文泉驿等宽正黑-12.0") ;;显示行号 (global-linum-mode t) ;;设置goto-line的快捷键 (global-set-key [?/C-/M-g] 'goto-line) ;;设置company-mode快捷键 (global-set-key (quote [C-return]) (quote company-etags)) ;;F2折叠代码 (global-set-key (quote [f2]) (quote hs-hide-block)) ;;F3打开代码 (global-set-key (quote [f3]) (quote hs-show-block)) ;;F4 narrow-to function (global-set-key (quote [f4]) (quote narrow-to-defun)) ;;F5 widen (global-set-key (quote [f5]) (quote widen)) ;;支持中文语言 (set-language-environment 'Chinese-GB) (set-keyboard-coding-system 'euc-cn) (set-clipboard-coding-system 'euc-cn) (set-terminal-coding-system 'euc-cn) (set-buffer-file-coding-system 'euc-cn) (set-selection-coding-system 'euc-cn) (modify-coding-system-alist 'process "*" 'euc-cn) (setq default-process-coding-system '(euc-cn . euc-cn)) (setq-default pathname-coding-system 'euc-cn) ;;设置org-mode ;;C-.=Timestamp (global-set-key [67108910] 'org-time-stamp) (put 'narrow-to-region 'disabled nil)