;;设置中文显示
(set-language-environment 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(set-clipboard-coding-system 'cn-gb-2312)
(set-terminal-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(set-selection-coding-system 'cn-gb-2312)
(set-default-coding-systems 'utf-8)
(setq locale-coding-system 'utf-8)
(modify-coding-system-alist 'process "*" 'utf-8)
(setq default-process-coding-system 'utf-8)
(setq default-pathname-coding-system 'utf-8)
;;其它设置
(setq default-major-mode 'text-mode) ;;默认启用text模式
(setq line-number-mode t) ;;显示行号
(setq column-number-mode t) ;;显示列号
(setq default-fill-column 80) ;;默认显示80列就换行
(setq mouse-yank-at-point t) ;;支持中间粘贴
(setq x-select-enable-clipboard t) ;;支持emacs和外部程序的粘贴
(setq frame-title-format "root@%b");;在标题栏提示你目前在什么位置
(setq-default indent-tabs-mode nil) ;;设置默认tab宽度为4
(setq-default c-basic-offset 4)
(setq-default tab-width 4)
(display-time-mode 1) ;;显示时间,格式如下
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(show-paren-mode t) ;;显示括号匹配
(tool-bar-mode nil) ;;去掉工具栏
(menu-bar-mode nil) ;;去掉工具栏
(scroll-bar-mode nil) ;;去掉滚动条
(fset 'yes-or-no-p 'y-or-n-p) ;;以y/n代替yes/no
(auto-image-file-mode t) ;;打开图片显示功能
(global-font-lock-mode t) ;;语法高亮
(mouse-avoidance-mode 'animate) ;;光标靠近鼠标指针时,让鼠标指针自动让开,别挡住视线
;;==================================================================
;;加载插件
(add-to-list 'load-path' "~/.emacs_plugins/")
(load-file "~/.emacs_plugins/cedet/common/cedet.el")
(require 'cc-mode)
(require 'xcscope)
;;==================================================================
;;C++设置
;;设置semanticdb代码搜索路径
;;(setq semanticdb-project-roots
;; (list
;; (expand-file-name "~/odinKitServer")
;; )
;;)
(defun my-cedet-hook()
(local-set-key [(f2)] 'semantic-symref-symbol) ;;查找变量调用的地方
(local-set-key [(f3)] 'semantic-symref) ;;查找函数调用的地方
;;(local-set-key [(f1)] 'semantic-ia-fast-jump)
;;(local-set-key [(f4)] 'semantic-ia-complete-symbol-menu)
;;(local-set-key [(control tab)] 'semantic-ia-complete-symbol)
;;(local-set-key "." 'semantic-complete-self-insert)
;;(local-set-key ">" 'semantic-complete-self-insert)
;;(local-set-key "\C-co" 'semantic-complete-analyze-inline)
;;(local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle)
;;(local-set-key "\C-cl" 'senator-completion-menu-popup)
)
(add-hook 'c-mode-common-hook 'my-cedet-hook)
;;显示speedbar
;;(global-set-key [(f5)] 'speedbar-get-focus)