我的EMACS配置文件

放在这里防止丢失,或许会不定时更新(毕竟不知道什么时候会突然找到一个更好地插件)

;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ecb-options-version "2.40"))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:family "Courier New" :foundry "outline" :slant normal :weight normal :height 151 :width normal)))))

(require 'linum)
(global-linum-mode t) ;;line num

(setq-default indent-tabs-mode nil) 
(setq c-basic-offset 4)
(setq default-tab-width 4) ;;tab width

(require 'generic-x)
(require 'electric)
(electric-pair-mode t)
(electric-layout-mode  t)
(electric-indent-mode t) ;;electric pair

(show-paren-mode t)
(setq show-paren-style 'parenthesis) ;;show paren

(require 'hl-line)
(global-hl-line-mode t) ;;high light line

(defun mycompile()
  (interactive)
  (save-buffer)
  (compile (format "g++ %s -o %s -g"(buffer-file-name)(substring buffer-file-name 0 -4)))
  )
(global-set-key [f7] 'mycompile) ;;use f7 for compile
(global-set-key [f8] 'shell)
(global-set-key [f9] 'gdb)

;;set transparent effect
(global-set-key [(f4)] 'loop-alpha)
(setq alpha-list '((100 100) (95 65) (85 55) (75 45) (65 35)))
(defun loop-alpha ()
  (interactive)
  (let ((h (car alpha-list)))                ;; head value will set to
    ((lambda (a ab)
       (set-frame-parameter (selected-frame) 'alpha (list a ab))
       (add-to-list 'default-frame-alist (cons 'alpha (list a ab)))
       ) (car h) (car (cdr h)))
    (setq alpha-list (cdr (append alpha-list (list h))))
    )
  )

(setq gdb-many-windows t) ;;many windows for gdb

(add-to-list 'load-path "~/.emacs.d/popup")
(add-to-list 'load-path "~/.emacs.d/auto-complete")
(require 'auto-complete)
(require 'auto-complete-config)

(add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-complete/dict")
(ac-config-default)


(add-to-list 'load-path "~/.emacs.d/color-theme")
(require 'color-theme)
(color-theme-initialize)
(color-theme-gray30)
;(color-theme-calm-forest)

;;(add-to-list 'load-path "~/.emacs.d/ecb")
;;(require 'ecb)
;;(global-set-key [f11] 'ecb-activate)

(defun refresh-file ()
  (interactive)
  (revert-buffer t (not (buffer-modified-p)) t))
 
(global-set-key [(f5)] 'refresh-file)

(defun split()
  (interactive)
  (delete-other-windows)
  (split-window-right)
  (enlarge-window-horizontally 15)
  (other-window 1)
  (split-window-below)
  (other-window 1)
  (other-window 1)
  (shell)
  (compile (format "g++ %s" (buffer-file-name)))
  (enlarge-window 8)
  (split-window-below)
  (split-window-right)
  (find-file (format "in.in"))
  (other-window 1)
  (find-file (format "out.out")))
(global-set-key [f6] 'split)

for Linux

;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:family "Courier 10 Pitch" :foundry "bitstream" :slant normal :weight normal :height 151 :width normal)))))

(require 'linum)
(global-linum-mode t) ;;line num

(setq-default indent-tabs-mode nil) 
(setq c-basic-offset 4)
(setq default-tab-width 4) ;;tab width

(require 'generic-x)
(require 'electric)
(electric-pair-mode t)
(electric-layout-mode  t)
(electric-indent-mode t) ;;electric pair

(show-paren-mode t)
(setq show-paren-style 'parenthesis) ;;show paren

(require 'hl-line)
(global-hl-line-mode t) ;;high light line

(defun mycompile()
  (interactive)
  (save-buffer)
  (compile (format "g++ %s -o %s -g"(buffer-file-name)(substring buffer-file-name 0 -4)))
  )
(global-set-key [f7] 'mycompile) ;;use f7 for compile
(global-set-key [f8] 'shell)
(global-set-key [f9] 'gdb)

;;set transparent effect
(global-set-key [(f4)] 'loop-alpha)
(setq alpha-list '((100 100) (95 65) (85 55) (75 45) (65 35)))
(defun loop-alpha ()
  (interactive)
  (let ((h (car alpha-list)))                ;; head value will set to
    ((lambda (a ab)
       (set-frame-parameter (selected-frame) 'alpha (list a ab))
       (add-to-list 'default-frame-alist (cons 'alpha (list a ab)))
       ) (car h) (car (cdr h)))
    (setq alpha-list (cdr (append alpha-list (list h))))
    )
  )

(setq gdb-many-windows t) ;;many windows for gdb

(add-to-list 'load-path "~/.emacs.d/popup")
(add-to-list 'load-path "~/.emacs.d/auto-complete")
(require 'auto-complete)
(require 'auto-complete-config)

(add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-complete/dict")
(ac-config-default)


(add-to-list 'load-path "~/.emacs.d/color-theme")
(require 'color-theme)
(color-theme-initialize)
(color-theme-gray30)
;(color-theme-calm-forest)

(add-to-list 'load-path "~/.emacs.d/mew.el")

;;(add-to-list 'load-path "~/.emacs.d/ecb")
;;(require 'ecb)
;;(global-set-key [f11] 'ecb-activate)

(defun refresh-file ()
  (interactive)
  (revert-buffer t (not (buffer-modified-p)) t))
 
(global-set-key [(f5)] 'refresh-file)

(defun split()
  (interactive)
  (delete-other-windows)
  (split-window-right)
  (enlarge-window-horizontally 15)
  (other-window 1)
  (split-window-below)
  (other-window 1)
  (other-window 1)
  (other-window 1)
  (compile (format "g++ %s" (buffer-file-name)))
  (shell)
  (enlarge-window 5)
  (split-window-below)
  (split-window-right)
  (find-file (format "in.in"))
  (other-window 1)
  (find-file (format "out.out"))
  )
(global-set-key [f6] 'split)

(setq send-mail-function (quote smtpmail-send-it))
(setq smtpmail-smtp-server "smtp.sina.com")
(setq smtpmail-smtp-service 25)
(setq user-full-name "graygoods")
(setq user-mail-address "graygoods@sina.com")

配套.emacs.d

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值