(fset 'yes-or-no-p 'y-or-n-p)
(display-time)
(transient-mark-mode t)
(show-paren-mode t)
(tool-bar-mode -1)
(set-scroll-bar-mode 'right)
(setq-default make-backup-files nil)
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/eieio")))
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/semantic")))
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/speedbar")))
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/ecb")))
(require 'ecb)
(setq ecb-tip-of-the-day nil)
(require 'xcscope)
(require 'gas-mode)
(add-to-list 'load-path "~/elisp")
(require 'color-theme)
(color-theme-oswald)
;(color-theme-calm-forest)
;(color-theme-euphoria)
;(color-theme-jonadabian)
;(color-theme-lawrence)
;(color-theme-matrix)
;(color-theme-parus)
(require 'linum)
(global-linum-mode t)
(setq frame-title-format "working in %b")
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/eim")))
(autoload 'eim-use-package "eim" "Another emacs input method")
(register-input-method
"eim-wb" "euc-cn" 'eim-use-package
"五笔" "汉字五笔输入法" "wb.txt")
;; 用 ; 暂时输入英文
(require 'eim-extra)
(global-set-key ";" 'eim-insert-ascii)
(setq user-mail-address "junjunyi@gmail.com")
(setq global-font-lock-mode t)
(setq semanticdb-default-save-directory "~/backups/emacs/semantic")
(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")))))
(setq semanticdb-project-roots
(list
(expand-file-name "/")))
(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 hipple-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
)
)
(defun my-c-mode-auto-pair ()
(interactive)
(make-local-variable 'skeleton-pair-alist)
(setq skeleton-pair-alist '(
(?` ?` _ "''")
(?/(? _ ")")
(?/[? _ "]")
(?{ /n > _ /n ?} >)))
(setq skeleton-pair t)
(local-set-key (kbd "(") 'skeleton-pair-insert-maybe)
(local-set-key (kbd "{") 'skeleton-pair-insert-maybe)
(local-set-key (kbd "`") 'skeleton-pair-insert-maybe)
(local-set-key (kbd "[") 'skeleton-pair-insert-maybe))
(add-hook 'c-mode-hook 'my-c-mode-auto-pair)
(add-hook 'c++-mode-hook 'my-c-mode-auto-pair)
(global-set-key [M-/] 'hippie-expand)
(global-set-key [C-f1] 'my-indent-or-complete)
(defun my-c-mode-common-hook ()
(setq default-tab-width 4)
(setq tab-width 4)
(setq c-basic-offset 4)
(hs-minor-mode t))
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
(load-library "hideshow")
(add-hook 'c-mode-hook 'hs-minor-mode)
(add-hook 'c++-mode-hook 'hs-minor-mode)
(add-hook 'java-mode-hook 'hs-minor-mode)
(add-hook 'perl-mode-hook 'hs-minor-mode)
(add-hook 'php-mode-hook 'hs-minor-mode)
(add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)
;; M-x hs-minor-mode
;; C-c @ ESC C-s show all
;; C-c @ ESC C-h hide all
;; C-c @ C-s show block
;; C-c @ C-h hide block
;; C-c @ C-c toggle hide/show
(display-time)
(transient-mark-mode t)
(show-paren-mode t)
(tool-bar-mode -1)
(set-scroll-bar-mode 'right)
(setq-default make-backup-files nil)
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/eieio")))
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/semantic")))
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/speedbar")))
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/ecb")))
(require 'ecb)
(setq ecb-tip-of-the-day nil)
(require 'xcscope)
(require 'gas-mode)
(add-to-list 'load-path "~/elisp")
(require 'color-theme)
(color-theme-oswald)
;(color-theme-calm-forest)
;(color-theme-euphoria)
;(color-theme-jonadabian)
;(color-theme-lawrence)
;(color-theme-matrix)
;(color-theme-parus)
(require 'linum)
(global-linum-mode t)
(setq frame-title-format "working in %b")
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/eim")))
(autoload 'eim-use-package "eim" "Another emacs input method")
(register-input-method
"eim-wb" "euc-cn" 'eim-use-package
"五笔" "汉字五笔输入法" "wb.txt")
;; 用 ; 暂时输入英文
(require 'eim-extra)
(global-set-key ";" 'eim-insert-ascii)
(setq user-mail-address "junjunyi@gmail.com")
(setq global-font-lock-mode t)
(setq semanticdb-default-save-directory "~/backups/emacs/semantic")
(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")))))
(setq semanticdb-project-roots
(list
(expand-file-name "/")))
(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 hipple-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
)
)
(defun my-c-mode-auto-pair ()
(interactive)
(make-local-variable 'skeleton-pair-alist)
(setq skeleton-pair-alist '(
(?` ?` _ "''")
(?/(? _ ")")
(?/[? _ "]")
(?{ /n > _ /n ?} >)))
(setq skeleton-pair t)
(local-set-key (kbd "(") 'skeleton-pair-insert-maybe)
(local-set-key (kbd "{") 'skeleton-pair-insert-maybe)
(local-set-key (kbd "`") 'skeleton-pair-insert-maybe)
(local-set-key (kbd "[") 'skeleton-pair-insert-maybe))
(add-hook 'c-mode-hook 'my-c-mode-auto-pair)
(add-hook 'c++-mode-hook 'my-c-mode-auto-pair)
(global-set-key [M-/] 'hippie-expand)
(global-set-key [C-f1] 'my-indent-or-complete)
(defun my-c-mode-common-hook ()
(setq default-tab-width 4)
(setq tab-width 4)
(setq c-basic-offset 4)
(hs-minor-mode t))
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
(load-library "hideshow")
(add-hook 'c-mode-hook 'hs-minor-mode)
(add-hook 'c++-mode-hook 'hs-minor-mode)
(add-hook 'java-mode-hook 'hs-minor-mode)
(add-hook 'perl-mode-hook 'hs-minor-mode)
(add-hook 'php-mode-hook 'hs-minor-mode)
(add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)
;; M-x hs-minor-mode
;; C-c @ ESC C-s show all
;; C-c @ ESC C-h hide all
;; C-c @ C-s show block
;; C-c @ C-h hide block
;; C-c @ C-c toggle hide/show