保存一下自已的emacs配置

(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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值