;; 设置字体
(set-default-font "Monospace-11")
;; 显示行号
(require 'linum)
(global-linum-mode 1)
;; Display line and column numbers
(setq line-number-mode t)
(setq column-number-mode t)
;; Make sure all backup files only live in one place
;; (setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
;; 不产生备份文件
(setq make-backup-files nil)
;;设置TAB宽度为4
(setq default-tab-width 4)
;;以下设置缩进
(setq c-indent-level 4)
(setq c-continued-statement-offset 4)
(setq c-brace-offset -4)
(setq c-argdecl-indent 4)
(setq c-label-offset -4)
(setq c-basic-offset 4)
(setq indent-tabs-mode t)
(setq standard-indent 4)
;; 重定义Enter,auto indent
(define-key global-map (kbd "RET") 'newline-and-indent)
;; 禁用终端响铃
(setq visible-bell t)
;;;;---------------- Global Hot Key --------------
;; F1:最大化当前buffer:
(global-set-key [(f1)] 'delete-other-windows)
;;F2打开speedbar
(global-set-key [(f2)] 'speedbar-get-focus)
;; F3:切换到shell模式
(global-set-key [(f3)] 'ansi-term)
;; F4:关闭buffer
(global-set-key [(f4)] 'kill-buffer-and-window)
;; F5: gdb:step
(global-set-key [(f5)] 'gud-step)
;; F6: gdb:next
(global-set-key [(f6)] 'gud-next)
;; 编译
(global-set-key [(f7)] 'compile)
;; F8:gdb
(global-set-key [(f8)] 'gdb)
;; F9跳到另一个窗口
(global-set-key [(f9)] 'other-window)
;; 取消ctrl+space
(global-unset-key (kbd "C-SPC"))
;;-----------------------------------------------
;; use cscope
;;(require 'xcscope)