2012년 5월 23일 수요일

emacs config file

출처 : http://chaoxifer.egloos.com/1258767

;; Font
;(set-default-font "Lucida Grande")

; Color
(require 'color-theme)
(color-theme-initialize)
(set-foreground-color "white")
(set-background-color "#4D4F4F")
(set-fringe-style "none")

; Change Switch buffer key
(global-unset-key (kbd "C-x <LEFT>"))
(global-set-key (kbd "C-,") 'previous-buffer)

(global-unset-key (kbd "C-x <RIGHT>"))
(global-set-key (kbd "C-.") 'next-buffer)

; 소스파일 브라우저 (cscope를 먼저 설치한다)
; xcscope.el 파일을 복사한다
; M-x cscope-index-file <ret>
(require 'xcscope) ; cscope 설치 후 연동

; line number
(add-hook 'find-file-hook (lambda ()(linum-mode 1)))

; Easier Transition between Windows
; M-up, M-down, M-lest and M-right keys
(windmove-default-keybindings 'meta)

;emacs tab configuration
(setq c-basic-offset 4
          tab-width 4
          indent-tabs-mode t)

; 엔터 입력시 자동 들여쓰기 다른 방법
(load "cc-mode")
(define-key c++-mode-map "\r" 'reindent-then-newline-and-indent)
(define-key c-mode-map "\r" 'reindent-then-newline-and-indent)
(define-key java-mode-map "\r" 'reindent-then-newline-and-indent)

; compile and debug
(global-set-key (kbd "<f7>") 'compile)
(global-set-key (kbd "<f4>") 'next-error)
;(global-set-key (kbd "\C-[") 


; 나눔고딕 글꼴을 미리 설치한다
(set-fontset-font "fontset-default" '(#x1100 . #xffdc)  '("NanumGothicCoding" . "unicode-bmp")) ;;; 유니코드 한글영역
(set-fontset-font "fontset-default" '(#xe0bc . #xf66e)  '("NanumGothicCoding" . "unicode-bmp")) ;;;유니코드 사용자 영역

;------------------------------------------------------------
;; for colorful ls in the shell-mode
;------------------------------------------------------------
(ansi-color-for-comint-mode-on)


(setq compilation-auto-jump-to-first-error t) 
(setq make-backup-files nil) ; do not create back files
(setq gdb-many-windows t) ; gdb windows

(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) ; disable scroll bar
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) ; disable tool bar
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1)) ; disable menu bar

(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.
 '(frame-background-mode (quote dark))
 '(global-hl-line-mode t))
(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 (:inherit nil :stipple nil :background "#4D4F4F" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :foundry "unknown" :family "Lucida Grande"))))
 '(button ((((supports :underline t)) nil)))
 '(custom-button ((((type x w32 ns) (class color)) (:underline t))))
 '(custom-button-mouse ((((type x w32 ns) (class color)) (:background "#4D4F4F"))))
 '(custom-button-pressed ((((type x w32 ns) (class color)) (:background "#4D4F4F"))))
 '(font-lock-comment-face ((((class color) (min-colors 88) (background dark)) (:foreground "#FF7777"))))
 '(font-lock-function-name-face ((((class color) (min-colors 88) (background dark)) (:foreground "deep sky blue" :underline "ivory" :weight bold))))
 '(font-lock-keyword-face ((((class color) (min-colors 88) (background dark)) (:foreground "DeepSkyBlue1"))))
 '(font-lock-string-face ((((class color) (min-colors 88) (background dark)) (:foreground "LightSalmon"))))
 '(font-lock-variable-name-face ((((class color) (min-colors 88) (background dark)) (:foreground "cornsilk"))))
 '(fringe ((((class color) (background dark)) (:background "#4D4F4F" :foreground "#4D4F4F"))))
 '(hl-line ((t (:inherit highlight))))
 '(link ((((class color) (min-colors 88) (background dark)) (:foreground "light goldenrod" :underline nil))))
 '(mode-line ((((class color) (min-colors 88)) (:background "#4d5f5f" :foreground "white"))))
 '(mode-line-highlight ((((class color) (min-colors 88)) nil)))
 '(region ((((class color) (min-colors 88) (background dark)) (:background "gray"))))
 '(tool-bar ((nil nil)))
 '(variable-pitch ((default nil) (nil nil))))

댓글 없음:

댓글 쓰기