(setq default-major-mode 'text-mode)
(global-font-lock-mode t)
(auto-image-file-mode t)
(fset 'yes-or-no-p 'y-or-n-p)
(column-number-mode t)
(show-paren-mode t)
(display-time-mode 1)
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(tool-bar-mode nil)
(scroll-bar-mode nil)
(mouse-avoidance-mode 'animate)
(setq mouse-yank-at-point t)
(transient-mark-mode t)
(setq x-select-enable-clipboard t)
(setq frame-title-format "%b@emacs")
(setq default-fill-column 80)
(blink-cursor-mode -1)
(set-default-font "文泉驿等宽微米黑-13")
(setq auto-save-default nil)
(setq-default make-backup-files nil)
(setq inhibit-startup-message t)
(setq visible-bell t)
(display-time)
(add-to-list 'load-path "~/.emacs.d")
;chinese-menu
(require 'english-menu)
(require 'chinese-menu)
(require 'mule-menu)
;tabbar
(require 'tabbar)
(tabbar-mode)
(global-set-key (kbd "s-;") 'tabbar-backward-group)
(global-set-key (kbd "s-'") 'tabbar-forward-group)
(global-set-key (kbd "s-,") 'tabbar-backward)
(global-set-key (kbd "s-.") 'tabbar-forward)
(set-face-attribute 'tabbar-default-face nil :family "文泉驿微米黑" :height 120)
(set-face-attribute 'mode-line nil :family "文泉驿微米黑" :height 120)
;color-theme
(require 'color-theme)
(color-theme-comidia)
;cedet
(load-file "~/.emacs.d/cedet/common/cedet.el")
(semantic-load-enable-code-helpers)
(require 'cedet)
;; Enabling Semantic (code-parsing, smart completion) feature, Select one of the following:
;; (semantic-load-enable-minimum-features)
(semantic-load-enable-code-helpers)
;; (semantic-load-enable-guady-code-helpers)
;; (semantic-load-enable-excessive-code-helpers)
;; (semantic-load-enable-semantic-debugging-helpers)
;; (global-set-key [(control tab)] 'senator-complete-symbol);
;; (global-set-key [(control tab)] 'senator-completion-menu-popup) ;; use C-c , SPC instead
;; (global-set-key [(control tab)] 'semantic-ia-complete-symbol)
;(global-set-key [(control tab)] 'semantic-ia-complete-symbol-menu)
;; 配置Semantic的检索范围:
;; (setq semanticdb-project-roots
;; (list
;; (expand-file-name "/")))
;; 设置semantic cache临时文件的路径,避免到处都是临时文件
(setq semanticdb-default-save-directory "~/.emacs.d/semantic.cache")
;; C/C++语言启动时自动加载semantic对/usr/include的索引数据库
(setq semanticdb-search-system-databases t)
(add-hook 'c-mode-common-hook
(lambda ()
(setq semanticdb-project-system-databases
(list (semanticdb-create-database
semanticdb-new-database-class
"/usr/include")))))
;ecb
(add-to-list 'load-path "~/.emacs.d/ecb")
(require 'ecb)
(autoload 'speedbar-frame-mode "speedbar" "Popup a speedbar frame" t)
(autoload 'speedbar-get-focus "speedbar" "Jump to speedbar frame" t)
(define-key-after (lookup-key global-map [menu-bar tools])
[speedbar]
'("Speedbar" .
speedbar-frame-mode)
[calendar])
(global-set-key [f12] 'ecb-activate)
(global-set-key [C-f12] 'ecb-deactivate)
(global-set-key [f11] 'delete-other-windows)
(global-set-key [(f5)] 'speedbar)
;ido
(require 'ido)
(ido-mode t)
;line-number
(global-linum-mode t)
;cscope
(require 'xcscope)
(setq cscope-do-not-update-database t)
;gdb
(setq gdb-many-windows t)
(load-library "multi-gud.el")
(load-library "multi-gdb-ui.el")
;sdcv
(require 'sdcv-mode)
(global-set-key (kbd "C-c d") 'sdcv-search)
;eim
(add-to-list 'load-path "~/.emacs.d/eim")
(autoload 'eim-use-package "eim" "Another emacs input method")
(setq eim-use-tooltip nil)
(register-input-method
"eim-wb" "euc-cn" 'eim-use-package
"五笔" "汉字五笔输入法" "wb.txt")
(register-input-method
"eim-py" "euc-cn" 'eim-use-package
"拼音" "汉字拼音输入法" "py.txt")
(setq default-input-method "eim-py")
;w3m
(add-to-list 'load-path "~/.emacs.d/w3m")
(require 'w3m-load)
(setq w3m-home-page "")
(setq w3m-command-arguments '("-cookie" "-F"))
(setq w3m-use-cookies t)
(setq w3m-default-display-inline-images t)
;emms
(add-to-list 'load-path "~/.emacs.d/emms")
(require 'emms-setup)
(emms-standard)
(emms-default-players)
(add-hook 'emms-player-started-hook 'emms-show)
(setq emms-show-format "NP: %s")
(setq emms-source-file-default-directory "/var/lib/mpd/music")
(require 'emms-i18n)
(require 'emms-history)
(require 'emms-player-mpd)
(setq emms-player-mpd-server-name "localhost")
(setq emms-player-mpd-server-port "6600")
(setq emms-player-mpd-music-directory "/var/lib/mpd/music")
(add-to-list 'emms-info-functions 'emms-info-mpd)
(add-to-list 'emms-player-list 'emms-player-mpd)
;emms-lyrics
(setq emms-lyrics-dir "~/.lyrics")
(setq emms-lyrics-coding-system nil)
(require 'emms-lyrics)
(emms-lyrics 1)
(setq emms-lyrics-display-on-minibuffer t)
(setq emms-lyrics-display-on-modeline nil)
;auto-complete
(add-to-list 'load-path "/root/.emacs.d/auto-complete")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "/root/.emacs.d/auto-complete/ac-dict")
(ac-config-default)
(setq ac-auto-show-menu 0.2)
(setq ac-use-menu-map t)
(define-key ac-menu-map "\C-n" 'ac-next)
(define-key ac-menu-map "\C-p" 'ac-previous)
;company,这个有点卡
(add-to-list 'load-path "~/.emacs.d/company")
(autoload 'company-mode "company" nil t)
;(setq company-idle-delay 0.2)
(setq company-idle-delay nil)
(add-hook 'c-mode-hook '(lambda () (company-mode)))
(add-hook 'c++-mode-hook '(lambda () (company-mode)))
(global-set-key [(control tab)] 'company-complete-common)
;yasnippet
(add-to-list 'load-path "~/.emacs.d/yasnippet")
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "~/.emacs.d/yasnippet/snippets")
(require 'cc-mode)
;;设置TAB宽度为4
(setq default-tab-width 4)
;;以下设置缩进
(setq c-indent-level 4)
(setq c-continued-statement-offset 4)
(setq c-brace-offset -4)
(setq c-argdecl-indent 4)
(setq c-label-offset -4)
(setq c-basic-offset 4)
(global-set-key "\C-m" 'reindent-then-newline-and-indent)
(setq indent-tabs-mode nil)
(setq standard-indent 4)
;;开启语法高亮。
(global-font-lock-mode 1)
;python-mode
(load "python-mode.el")
(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)
(setq font-lock-maximum-decoration t)
;eshell
(defalias 'em 'find-file)
;tramp
(require 'tramp)
(setq tramp-default-method "scp")
;(setq tramp-default-user "username"
; tramp-default-host "hostname")