Software Workshop

Emacs는 홈 디렉토리의 .emacs 파일을 수정하여 설정을 customize할 수 있다.

개인적으로 사용하고 있는 설정

(require 'cl)
  
;;
;; Global Settings
;;
(setq transient-mark-mode t)
(transient-mark-mode 1)
;(setq show-paren-mode t nil (paren))
(show-paren-mode t)
(setq frame-title-format (concat  "%b - emacs@" system-name))
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
  
;; font-lock-mode
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
;(setq-default font-lock-maximum-size 102400)
  
;;
;; Korean Settings
;;
(when enable-multibyte-characters
  (set-language-environment "Korean")
  (setq locale-value
        (if (string= (getenv "LANG") "ko_KR.utf8") 'utf-8 'euc-kr))
  (prefer-coding-system locale-value)
  (set-default-coding-systems locale-value)
  
  (setq-default file-name-coding-system locale-value)
  (setq-default locale-coding-system locale-value)
  (set-terminal-coding-system locale-value)
  (set-keyboard-coding-system locale-value)
  (set-selection-coding-system locale-value)
)
(when (string-match "^3" (or (getenv "HANGUL_KEYBOARD_TYPE") ""))
    (setq default-korean-keyboard "3")
    (setq default-input-method "korean-hangul3")
)
  
(dynamic-completion-mode)
  
;;
;; Shell
;;
  
(setq shell-file-name "bash")
(setq shell-command-switch "-c")
(setq explicit-shell-file-name shell-file-name)
(setenv "SHELL" shell-file-name)
(setq explicit-sh-args '("-login" "-i"))
  
;;
;; Key Binding
;;
  
(global-set-key "\M-\:" 'goto-line);
(global-set-key "\M-\," 'pop-tag-mark)
(global-set-key [\M-right] 'call-last-kbd-macro)
(global-set-key [(f5)] 'compile)
;; alternative to Ctrl-Space in Windows 7
(global-set-key "\C-x " 'set-mark-command)
  
;;
;; Programming Setting
;;
  
;(setq c-default-style "K&R")
;(setq c-basic-offset 4 tab-width 4 indent-tabs-mode nil)
;(setq default-tab-width 4)
;(setq-default fill-column 75)
;(setq c-default-style "GNU")
(setq c-default-style
      '((java-mode . "java") (c++-mode . "stroustrup") (other . "k&r")))
(setq c-basic-offset 4)
(setq-default indent-tabs-mode nil)
;(iswitchb-mode)
;(which-function-mode)
;(speedbar)
  
(add-to-list 'auto-mode-alist '("\\.h$" . c++-mode))
(add-to-list 'auto-mode-alist '("\\.cc$" . c++-mode))
(add-to-list 'auto-mode-alist '("\\.cpp$" . c++-mode))
(add-to-list 'auto-mode-alist '("\\.tcc$" . c++-mode))
(add-to-list 'auto-mode-alist '("\\.inc$" . php-mode))
  
;; ruby
;(require 'inf-ruby)
;(require 'ruby-mode)
;(require 'rubydb)
;(require 'ruby-electric)
(autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files" t)
(setq auto-mode-alist (append '(("\\.rb$" . ruby-mode)) auto-mode-alist))
;(setq interpreter-mode-alist (append '(("ruby" . ruby-mode)) interpreter-mode-alist))
;(autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process")
;(autoload 'inf-ruby-keys "inf-ruby" "Set local key defs for inf-ruby in ruby-mode")
;(add-hook 'ruby-mode-hook '(lambda () (inf-ruby-keys)))
  
;; make-regexp
(autoload 'make-regexp "make-regexp"
  "Return a regexp to match a string item in STRINGS.")
(autoload 'make-regexps "make-regexp"
  "Return a regexp to REGEXPS.")
  
;; GNU Flex
;(autoload 'flex-mode "flex-mode.el" "GNU Flex document" t)
;(add-to-list 'auto-mode-alist '("\\.l$" . bison-mode))
(add-to-list 'auto-mode-alist '("\\.l$" . c-mode))
  
;; GNU Bison
;(autoload 'bison-mode "bison-mode.el" "GNU Bison document" t)
;(add-to-list 'auto-mode-alist '("\\.y$" . bison-mode))
(add-to-list 'auto-mode-alist '("\\.y$" . c-mode))
  
;; ESQL/C
(add-to-list 'auto-mode-alist '("\\.pgc$" . c++-mode))
  
;; LaTeX
;(setq tex-dvi-view-command "xdvi")
  
;; PHP
;(autoload 'php-mode "php-mode.el" "PHP document" t)
;(add-to-list 'auto-mode-alist '("\\.php$" . php-mode))
  
;; python
;(autoload 'python-mode "python-mode" "Python editing mode" t)
;(add-to-list 'auto-mode-alist '("\\.py$" . python-mode))
  
(set-fontset-font "fontset-default" '(#x1100 . #xffdc) '("NanumGothic_Coding" . "unicode-bmp"))
(set-fontset-font "fontset-default" '(#xe0bc . #xf66e) '("NanumGothic_Coding" . "unicode-bmp"))