;;;;;;;;;;;;;; Global ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; (Setq visible-bell T); close the beep prompt when an error occurs
(Mouse-avoidance-mode 'animate). When the mouse arrow is similar to the cursor, the mouse arrow is automatically removed.
; (Blink-cursor-mode nil); the cursor does not flash
(Setq-default cursor-type 'bar); the cursor is displayed as a vertical line.
; (Tool-bar-mode-1); The emcas toolbar is not displayed.
; (Menu-bar-mode-1); the menu bar of emcas is not displayed. Press Ctrl + Right-click to bring up the menu.
;;;;;;;;;;;;;;;;; Maximize ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(Setq default-frame-alist '(height. 38) (width. 125) (menu-bar-lines. 20) (tool-bar-lines. 0 )))
(Setq X-select-enable-clipboard T); supports pasting between Emacs and external programs
(Fset 'Yes-or-no-p' y-or-n-P); replace the default 'yes/No' with 'y/N '.
(Setq frame-title-format "% B @ xgd-Emacs"); display the name of the current buffer in the top title bar
; (Setq make-backup-files nil); disable the automatic backup function
; (Setq auto-save-mode nil); Disable auto save mode
; (Setq auto-save-default nil); do not generate a temporary file named # filename #
(Setq require-Final-newline T); automatically adds a blank line at the end of the current buffer File
(Global-set-key "\ r" 'align-newline-and-indent );
(Set-scroll-bar-mode 'right); the scroll bar is on the right.
(Set-scroll-bar-mode nil); no scroll bar is displayed. Even in X-window system (recommended)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;
;;;;;;;;;;;; CC-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Http://cc-mode.sourceforge.net/
Http://www.kklinux.com/html/linuxwangluojishu/linuxxitongguanliyuan/200902/28-3728.html
; (Add-to-list 'Load-path "/home/xgdxiao/. emacsloadpath/cc-mode-5.31.3 ")
(Require 'CC-mode)
(C-set-offset 'inline-open 0)
(C-set-offset 'friend '-)
(C-set-offset 'substatement-open 0)
(Defun my-C-mode-hook ()
(Setq tab-width 4 indent-Tabs-mode nil)
(C-set-style "stroustrup ")
);;
(Add-hook 'C-mode-hook 'My-C-mode-hook)
(Add-hook 'C ++-mode-hook 'My-C-mode-hook)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;
(Add-to-list 'Load-path "~ /. Emacs "); load-Path
;;;;;;;;;;;;;;;; Color-theme ;;;;;;;;;;;;;;;;;;;;;
(Require 'color-theme)
(Color-theme-classic)
;;;;;;;;;;;;;;;; Display the row number in Web mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Download the wb-line-number.el and place it in
Http://homepage1.nifty.com/blankspace/emacs/elisp.html
; (Require 'wb-line-number)
; (WB-line-number-Toggle)
;;;;;;;;;;;;;;;;; Maximize ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; (Require 'maxframe)
; (Add-hook 'window-setup-hook' maximize-frame T)
; Download maxframe. El and place it in
Http://emacsblog.org/2007/02/22/maximize-on-startup-part-2/
;;;;;;;;;;;;;;;;; Session ;;;;;;;;;;;;;;;;;;;;;;;;;
(Add-to-list 'Load-path "~ /. Emacs/session/lisp ")
(Require 'session)
(Add-hook 'after-init-hook' session-Initialize)
; Record and restore the screen
(Load "desktop ")
; (Desktop-load-default)
; (Desktop-read)
; Automatic disk storage mode for desktop, 23 needs to be added
(Desktop-save-mode)
;;;;;;;;;;;;;;;;; Cscope ;;;;;;;;;;;;;;;;;;;;;;;;;
(Require 'xcscope)
(Global-set-key "\ c-XG" 'csbench-find-global-definition-no-prompting); jump to global definition
(Setq CSQ-database-file "cscope. DB ")
;;;;;;;;;;;;;;;;; Cedet ;;;;;;;;;;;;;;;;;;;;;;;;;;
(Add-hook 'texinfo-mode-hook (lambda () (require 'SB-texinfo )))
(Load-file "~ // Emacs/cedet-1.0/common/cedet. El ")
(Semantic-load-enable-code-helpers)
(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])
; Read special. El files in sub-Directories
(Global-Ede-mode 1); enable the Project Management System
(Semantic-load-enable-code-helpers); Enable prototype help and smart completion
(Global-srecode-minor-mode 1); Enable template insertion menu
(Global-set-Key [(F4)] 'speedbar-get-Focus); speedbar
; (Define-key C-mode-base-map "." 'semantic-complete-Self-insert );
(Define-key C-mode-base-map [(control tab)] 'semantic-Ia-complete-symbol-menu); Automatically complete Ctrl + tab; (control tab) (meta? /)
(Require 'semantic-GCC); System header files within GCC
;;;;;;;;;;;;;;;;; ECB ;;;;;;;;;;;;;;;;;;;;;;;;;
(Add-to-list 'Load-path "~ /. Emacs/ecb-2.40 ")
(Load-file "~ /. Emacs/ecb-2.40/ECB. El ")
(Require 'ecb)
(Setq ECB-auto-activate T; automatically starts ECB
ECB-tip-of-the-day nil; daily reminders are not displayed
ECB-tree-indent 4
ECB-Windows-height 0.5
ECB-windows-width 0.20
ECB-auto-compatibility-check Nil
ECB-version-check Nil
Inhibit-startup-message T)
(Global-set-Key [F8] 'ecb-activate); defines the F8 key to activate ECB
(Global-set-Key [F7] 'ecb-deactivate); defines F7 as stopping ECB
; Switch between windows
(Global-set-Key [M-Left] 'windmove-left)
(Global-set-Key [M-right] 'windmove-right)
(Global-set-Key [M-Up] 'windmove-up)
(Global-set-Key [M-Down] 'windmove-down)
; Maximize a ECB window
(Define-key global-map "\ C-c1" 'ecb-maximize-window-Directories)
(Define-key global-map "\ C-c2" 'ecb-maximize-window-sources)
(Define-key global-map "\ C-c3" 'ecb-maximize-window-methods)
(Define-key global-map "\ C-c4" 'ecb-maximize-window-History)
; Restore the original window layout
(Define-key global-map "\ c-C'" 'ecb-restore-default-window-sizes)
(Define-key global-map "\ C-c5" 'ecb-show-ECB-Windows)
(Define-key global-map "\ C-c6" 'ecb-hide-ECB-Windows)
;;;;;;;;;;;;;;;;;;; End ECB ;;;;;;;;;;;;;;;;;;;;;;;;
(Custom-set-Variables
; Custom-set-variables was added by custom.
; If you edit it by hand, you coshould mess it up, so be careful.
; Your init file shoshould contain only one such instance.
; If there is more than one, they won't work right.
'(ECB-layout-window-sizes nil)
'(ECB-primary-secondary-mouse-buttons (Quote mouse-1 -- mouse-2 )))
(Custom-set-Faces
; Custom-set-faces was added by custom.
; If you edit it by hand, you coshould mess it up, so be careful.
; Your init file shoshould contain only one such instance.
; If there is more than one, they won't work right.
)
; The semantic/usr/include index database is automatically loaded when the C/C ++ language is started.
(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 ")))))
; Project root path
(Setq semanticdb-project-roots
(List
(Expand-file-name "/")))
; Avoid using too much CPU for semantic
(Setq-default semantic-idle-scheduler-idle-time 432000)
(Defun my-indent-or-complete ()
(Interactive)
(If (looking-at "\> ")
(Hippie-expand nil)
(Indent-for-tab-command )))
(Autoload 'Senator-try-expand-semantic "senator ")
(Setq hippie-expand-try-functions-list
'(
Senator-try-expand-semantic
Try-expand-dabbrev
Try-expand-dabbrev-visible
Try-expand-dabbrev-all-Buffers
Try-expand-dabbrev-from-kill
Try-expand-list
Try-expand-list-all-Buffers
Try-expand-line
Try-expand-line-all-Buffers
Try-complete-file-name-partially
Try-complete-file-name
Try-expand-whole-kill
)
)
;;;;;;;; # GDB ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
(Global-set-Key [(F5)] 'gdb-starter-Windows); GDB-starter-windows shortcut key [F5]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;; # Compile ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;
(Define-key C-mode-base-map [(F9)] 'compile); Compile command shortcut key of Emacs F9
(Setq compile-command "make-k ")