;(custom-set-variables ; '(c-basic-offset 4) ;; '(tab-width 4) ;; '(c-old-style-variable-behavior t) ; '(global-font-lock-mode t nil (font-lock))) ;(custom-set-faces) ;; Color settings. (set-background-color "#333333") (set-foreground-color "White") (set-cursor-color "White") (setq c-default-style "linux") ;(c-set-style "linux") ; remove startup splash message/screen (setq inhibit-splash-screen t) ;; Show unnecessary spaces at the end of a line (setq-default show-trailing-whitespace t) ; Alt-g for goto-line (define-key global-map "\M-g" 'goto-line) ; Ctrl-C g for goto-line (global-set-key "\C-cg" 'goto-line) ; Ctrl-C w for what-line (global-set-key "\C-cw" 'what-line) ; Ctrl-C c for compile (global-set-key "\C-cc" 'compile) ;; setup scroll mouse settings (defun up-slightly () (interactive) (scroll-up 5)) (defun down-slightly () (interactive) (scroll-down 5)) (global-set-key [mouse-4] 'down-slightly) (global-set-key [mouse-5] 'up-slightly) (defun up-one () (interactive) (scroll-up 1)) (defun down-one () (interactive) (scroll-down 1)) (global-set-key [S-mouse-4] 'down-one) (global-set-key [S-mouse-5] 'up-one) (defun up-a-lot () (interactive) (scroll-up)) (defun down-a-lot () (interactive) (scroll-down)) (global-set-key [C-mouse-4] 'down-a-lot) (global-set-key [C-mouse-5] 'up-a-lot) ;; Add new menu item under "Serach" menu. ;; Function: it list all functions in the current buffer ;(add-hook 'c-mode-hook ; (function (lambda () ; (define-key global-map ; [menu-bar search browse] ; '("Browse" . imenu))))) ;; Ctrl-Shift left mouse button => list all functions in buffer ;(define-key global-map ; [C-S-down-mouse-1] 'imenu) ;(set 'c-basic-offset 4) ;(c-add-style "lumen" '("gnu" ; (c-basic-offset . 4) ; (c-offset-alist (case-label . +)))) ;(c-set-style "lumen") ;(defun my-set-style () ; (c-set-style "lumen") ;) ;(add-hook 'c-mode-hook 'my-set-style)