; Ignore default configuration files. (setq inhibit-default-init t) ; Force smooth scrolling. (setq scroll-step 1) ; Display the column number in the status bar. The first column is 0. (setq column-number-mode t) ; Display the current time in the status bar. (display-time) ; Arrow-down and C-n should not add lines at the end of the buffer. (setq next-line-add-newlines nil) ; Automatically indent when we hit the Enter key so that we don't ; need to keep using the Tab key to align things when coding. (global-set-key "\C-m" 'newline-and-indent) ; Settings common to both C mode and C++ mode. (defun ms-visual-cpp () (turn-on-auto-fill) (c-set-style "stroustrup") (setq fill-column 71) (setq comment-column 36) (setq c-auto-newline t)) ; Settings for C mode. (add-hook 'c-mode-hook '(lambda () (ms-visual-cpp) (setq c-hanging-braces-alist (append '((class-open after) (class-close)) c-hanging-braces-alist)))) ; Settings for C++ mode. (add-hook 'c++-mode-hook '(lambda () (ms-visual-cpp) (setq c-hanging-braces-alist (append '((class-close)) c-hanging-braces-alist)) (setq c-hanging-colons-alist (append '((access-label after) (case-label after)) c-hanging-colons-alist)))) ; Settings for operating under X (or possibly Windows). (if window-system (progn ; Display the name of the current buffer in the title bar. (setq frame-title-format "Emacs: %b") (setq icon-title-format frame-title-format) (global-font-lock-mode t) (setq font-lock-maximum-decoration t) (set-background-color "White") (set-foreground-color "Black") (set-cursor-color "Black") (setq font-lock-mode-hook '(lambda () (set-face-foreground 'default "Black") (set-face-background 'default "White") (make-face 'comments) (make-face 'keywords) (make-face 'function-name) (make-face 'variable-name) (make-face 'string) (make-face 'type) (make-face 'reference) (make-face 'constant) (make-face 'builtin) (make-face 'warning) (make-face 'preprocessor) (set-face-foreground 'comments "DarkGreen") (set-face-foreground 'keywords "Blue") (set-face-foreground 'function-name "Red") (set-face-foreground 'variable-name "Black") (set-face-foreground 'string "ForestGreen") (set-face-foreground 'type "Blue") (set-face-foreground 'reference "Black") (set-face-foreground 'constant "Black") (set-face-foreground 'builtin "Black") (set-face-foreground 'warning "Black") (set-face-foreground 'preprocessor "Black") (setq font-lock-comment-face 'comments) (setq font-lock-keyword-face 'keywords) (setq font-lock-function-name-face 'function-name) (setq font-lock-variable-name-face 'variable-name) (setq font-lock-string-face 'string) (setq font-lock-type-face 'type) (setq font-lock-reference-face 'reference) (setq font-lock-constant-face 'constant) (setq font-lock-builtin-face 'builtin) (setq font-lock-warning-face 'warning) (setq font-lock-preprocessor-face 'preprocessor)))))