(setq gdb-many-windows 't) ; 't는 toggle.
(global-set-key [f5] 'gud-run) ; run 명령 실행
(global-set-key [f9] 'gud-break) ; 소스창에서 바로 브레이크포인트 설정
(global-set-key [f10] 'gud-next) ; 현재 라인 실행하고 다음 라인으로
(global-set-key [f11] 'gud-step) ; 현재 함수안으로 따라 들어간다
(global-set-key [:(shiftF11) (shift f11)] 'gud-finish) ; 현재 실행중인 함수 리턴후 멈춤
(global-set-key [:(shiftF10) (shift f10)] '(lambda () ; 현재 커서까지 실행하고 멈춤
(interactive)
(call-interactively 'gud-tbreak)
(call-interactively 'gud-cont)))
(defun gud-answer-with-yes()
(interactive)
(save-excursion
(set-buffer gud-comint-buffer)
(insert "y")
(comint-send-input)))
(defun gud-answer-with-no()
(interactive)
(save-excursion
(set-buffer gud-comint-buffer)
(insert "n")
(comint-send-input)))
; gdb key-binding
(defun gdb-mode-additional-keys()
(gud-def gud-run "run" "\C-g" "Run the Program.") ; 위에서 f5로 매핑
(gud-def gud-kill "kill" "\C-k" "Kill the program.") ; gud-kill을 새로 정의하고 C-x C-a C-k로 매핑
(gud-def gud-quit "quit" "\C-q" "Quit the program.") ; gud-quit을 새로 정의하고 C-x C-a C-q로 매핑
(global-set-key [(control x)(control a)(control y)] 'gud-answer-with-yes) ; C-x C-a C-y로 gdb에 y보내기
(global-set-key [(control x)(control a)(control n)] 'gud-answer-with-no)) ; C-x C-a C-n로 gdb에 n보내기
(add-hook 'gdb-mode-hook 'gdb-mode-additional-keys) ; 추가한 단축키 들을 등록
; line number
(global-linum-mode 'enable)
; highlight search
(defun viper-flash-search-pattern ()
(hi-lock-mode 0) (hi-lock-mode 1)
(hi-lock-set-pattern
(car viper-search-history) 'hi-green))
(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.
)
(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 83 :width normal :foundry "microsoft" :family "Consolas")))))