备份.emacs

;;color
(set-face-background 'default "black")
(set-face-foreground 'default "gray")

;;cmake
(require 'cmake-mode)
(setq auto-mode-alist
(append
'(("CMakeLists\\.txt\\'" . cmake-mode))
'(("\\.cmake\\'" . cmake-mode))
auto-mode-alist))

(require 'cedet)
(global-ede-mode t)

;;enable default function
(semantic-mode 1)

;;enable semantic idle complete
(global-semantic-idle-completions-mode)
(setq semantic-complete-inline-analyzer-idle-displayor-class 'semantic-displayor-traditional)

;;enable semantic idle summary mode
(global-semantic-idle-summary-mode)

;;set the way of semantic search
(setq-mode-local c++-mode
semanticdb-find-default-throttle
'(file project local unloaded system recursive))

(setq-mode-local c-mode
semanticdb-find-default-throttle
'(file project local unloaded system recursive))

;;higlight fun
(global-semantic-highlight-func-mode)

;;decoration mode
(global-semantic-decoration-mode)
(setq semantic-toggle-decoration-style 'semantic-tag-boundary)

;;speedbar
(require 'semantic/sb)
(speedbar)

;;mru bookmark
(global-semantic-mru-bookmark-mode)

;;sticky func mode
(global-semantic-stickyfunc-mode)

;;imenu tag
(defun my-semantic-hook () (imenu-add-to-menubar "TAGS"))
(add-hook 'semantic-init-hooks 'my-semantic-hook)

;;semantic qt4 support
(setq qt4-base-dir "/opt/qtomap/usr/include")
(setq qt4-gui-dir (concat qt4-base-dir "/QtGui"))
(semantic-add-system-include qt4-base-dir 'c++-mode)
(semantic-add-system-include "/opt/qtomap/usr/include/QtCore" 'c++-mode)
(semantic-add-system-include qt4-gui-dir 'c++-mode)
(semantic-add-system-include "/opt/qtomap/usr/include/QtNetwork" 'c++-mode)
(add-to-list 'auto-mode-alist (cons qt4-base-dir 'c++-mode))
(setq semantic-lex-c-preprocessor-symbol-file '())
(add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qconfig.h"))
(add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qconfig-large.h"))
(add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qglobal.h"))
(setq semantic-lex-c-preprocessor-symbol-map '())
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("Q_GUI_EXPORT" . ""))
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("Q_CORE_EXPORT" . ""))

;;add c++ include
(semantic-add-system-include "/usr/include/c++/4.5" 'c++-mode)
(add-to-list 'auto-mode-alist (cons "/usr/include/c++" 'c++-mode))
(add-to-list 'semantic-lex-c-preprocessor-symbol-map '("__nonnull" . ""))

;;;; Semantic DataBase Location
(setq semanticdb-default-save-directory
(expand-file-name "~/.emacs.d/semanticdb"))

;;;; C-mode-hooks .
(defun myc-mode-keys ()
(local-set-key "." 'semantic-complete-self-insert)
(local-set-key ">" 'semantic-complete-self-insert)
)

(defun myc-mode-toggle ()
(c-toggle-auto-newline)
;(setq c-offsets-alist '((substatement-open . 0))) ;set substatement no add space if {}
)


(add-hook 'c++-mode-hook 'myc-mode-keys)
(add-hook 'c-mode-hook 'myc-mode-keys)
(add-hook 'c++-mode-hook 'myc-mode-toggle)
(add-hook 'c-mode-hook 'myc-mode-toggle)


;setup gdb
(setq gdb-many-windows 1)
(defun mygdb-mode-hook ()
(gud-tooltip-mode)
)

(add-hook 'gdb-mode-hook 'mygdb-mode-hook)

(setq x-select-enable-clipboard t);

你可能感兴趣的:(File,database,System,qt,include,Semantic)