음.
gtk를 공부하게 되면서 살짝 바꿔보았습니다.
이 설정은 저의 개인적인 백업 설정에 가깝습니다 ㅇㅅㅇ.
플러그인은 이쪽 -> http://youtil.wo.tc/55
(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.
'(column-number-mode t)
'(cua-mode t nil (cua-base))
'(semantic-c-dependency-system-include-path (quote ("/usr/include" "/opt/gtk/include/gtk-3.0/" "/opt/gtk/include/gail-3.0/")))
'(show-paren-mode t)
'(speedbar-directory-unshown-regexp "^\\(CVS\\|RCS\\|SCCS\\)\\'")
'(speedbar-ignored-directory-expressions nil)
'(speedbar-show-unknown-files t)
'(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify))))
(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 "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))
;;Window Change.
(windmove-default-keybindings 'meta)
;;Line Delete
(defun ej-kill-line ()
"kill whole line"
(interactive)
(beginning-of-line)
(kill-line))
(global-set-key "\C-k" 'ej-kill-line)
(defun change-compile-cmd ()
(interactive)
(if (equal compile-command "gcc -o ")
(setq compile-command "g++ -o ")
(setq compile-command "gcc -o "))
(print compile-command))
(defun change-compile-cmd-gtk ()
(interactive)
(if (equal compile-command "gcc `pkg-config --cflags --libs gtk+-2.0` -o ")
(setq compile-command "g++ `pkg-config --cflags --libs gtk+-2.0` -o ")
(setq compile-command "gcc `pkg-config --cflags --libs gtk+-2.0` -o "))
(print compile-command))
(global-set-key (kbd "C-c >") 'change-compile-cmd)
(global-set-key (kbd "C-c <") 'change-compile-cmd-gtk)
;;HanGul Font
(set-fontset-font "fontset-default" '(#x1100 . #xffdc) '("NanumGothicCoding" . "unicode-bmp"))
(set-fontset-font "fontset-default" '(#xe0bc . #xf66e) '("NanumGothicCoding" . "unicode-bmp"))
(set-fontset-font "fontset-default" 'kana '("NanumGothicCoding" . "unicode-bmp"))
(set-fontset-font "fontset-default" 'han '("NanumGothicCoding" . "unicode-bmp"))
;;Hilight Line
(global-hl-line-mode 1)
(set-face-background 'hl-line "#FFDCDC")
(set-face-foreground 'highlight nil)
(set-face-foreground 'hl-line nil)
;;Coding
(setq c-basic-offset 4 tab-width 4 indent-tabs-mode t)
(global-font-lock-mode t)
(show-paren-mode t)
;;Vim Style Line Number
(add-hook 'find-file-hook (lambda ()(linum-mode 1)))
(line-number-mode 1)
(column-number-mode 1)
;;C
(add-hook 'c-mode-hook'
(lambda ()
(c-set-style "bsd")
(setq default-tab-width 4)
(setq indent-tabs-mode t)
(setq c-basic-offset 4)
))
;;C++
(add-hook 'c++-mode-hook'
(lambda ()
(c-set-style "bsd")
(setq default-tab-width 4)
(setq indent-tabs-mode t)
(setq c-basic-offset 4)
))
(add-hook 'c-mode-common-hook '(lambda ()
(local-set-key (kbd "RET") 'newline-and-indent)))
;;
;;Plugins
;;
;;Auto Complete ()
(add-to-list 'load-path "~/.emacs.d/Plugins")
(require 'autopair)
(autopair-global-mode)
(global-set-key (kbd "C-c SPC") 'autopair-global-mode)
;;Auto Install Plugins
(add-to-list 'load-path "~/.emacs.d/Plugins")
(require 'auto-install)
(setq auto-install-directory "~/.emacs.d/Plugins/")
(auto-install-update-emacswiki-package-name t)
;;HideShow Mode
(load-library "hideshow")
(defun HideShow-KeyBinding()
(hs-minor-mode t)
(local-set-key (kbd "C-c C-s") 'hs-show-block)
(local-set-key (kbd "C-c C-b") 'hs-hide-block)
(local-set-key (kbd "C-c C-S-b") 'hs-hide-all)
(local-set-key (kbd "C-c C-S-S") 'hs-show-all))
(add-hook 'c-mode-hook 'HideShow-KeyBinding)
(add-hook 'c++-mode-hook 'HideShow-KeyBinding)
(add-hook 'emacs-lisp-mode-hook 'HideShow-KeyBinding)
(defadvice goto-line (after expand-after-goto-line
activate compile)
"hideshow-expand affected block when using goto-line in a collapsed buffer"
(save-excursion
(hs-show-block)))
;;Reload .emacs
(defun reload-dotemacs ()
"Reload .emacs"
(interactive)
(byte-compile-file "~/.emacs")
(load-file "~/.emacs.elc"))
(global-set-key (kbd "C-M-e") 'reload-dotemacs)
;;yasnippet
(add-to-list 'load-path "~/.emacs.d/Plugins")
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "~/.emacs.d/Plugins/snippets")
;;auto complete
(require 'auto-complete)
(global-auto-complete-mode t)
(when (require 'auto-complete nil t)
(global-auto-complete-mode t)
(set-face-background 'ac-selection-face "steelblue")
; (define-key ac-complete-mode-map "\t" 'ac-expand)
(define-key ac-complete-mode-map "\t" 'ac-complete)
(define-key ac-complete-mode-map "\C-\M-n" 'ac-next)
(define-key ac-complete-mode-map "\C-\M-p" 'ac-previous)
(setq ac-auto-start t)
(setq ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-words-in-buffer))
(add-to-list 'ac-modes 'eshell-mode)
(add-hook 'emacs-lisp-mode-hook
(lambda ()
(make-local-variable 'ac-sources)
(setq ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-words-in-buffer ac-source-symbols))))
(add-hook 'eshell-mode-hook
(lambda ()
(make-local-variable 'ac-sources)
(setq ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-files-in-current-dir ac-source-words-in-buffer)))))
;;intellisense
(load-file "~/cedet/common/cedet.el")
(global-ede-mode 1)
(semantic-load-enable-minimum-features)
(semantic-load-enable-code-helpers)
(setq semanticdb-default-save-directory "~/.emacs.d/#cache#")
(semantic-add-system-include "/usr/include")
(semantic-add-system-include "/opt/gtk/include")
(global-set-key [(control c)(control return)] 'semantic-complete-analyze-inline)
(global-set-key (kbd "C-c C-i") 'semantic-decoration-all-include-summary)
;;Flymake
(require 'flymake)
(require 'flymake-cursor)
;;Cscope
(require 'xcscope)
;;theme
(require 'color-theme-tomorrow)
(color-theme-tomorrow-night-eighties)
(put 'downcase-region 'disabled nil)
;;CSharp
(require 'csharp-mode)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Python! ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(global-set-key (kbd "C-x p") 'python-shell)
8번째 줄은 gtk를 공부하기 시작하면서 cedet 가 gtk의 헤더파일을 인식 할 수 있게 include 폴더를 지정해 둔 것입니다.
필요 없으신 분은 gtk가 들어간 경로를 전부 지워주세요.
32-47 줄도 마찬가지 입니다.
'Programming||Study' 카테고리의 다른 글
그래픽 개자식.. 죽일테다... (0) | 2013.05.21 |
---|---|
Emacs for Mac (CEDET 버그 수정 및 폰트 문제 해결) (0) | 2012.08.31 |
emacs A-x compile 기본 설정 명령어 변경 및 설정파일 리로드 (0) | 2012.03.21 |
emacs 를 처음으로 사용해 보았습니다. (0) | 2012.03.11 |
이런 잉여가 될줄이야. (0) | 2012.03.08 |