;
; get rid of save abbrevs question
;
(setq save-abbrevs nil)

;
; get rid of that #!#!@ startup screen
;
(setq inhibit-splash-screen t)

;
; no scrollbar
;
(scroll-bar-mode -1)

;
; no icon menu
;
(tool-bar-mode 0)

;
; no menu bar
;
(menu-bar-mode 0)

;
; disable stupid SGML entity warning
;
(setq sgml-warn-about-undefined-entities nil)

;
; syntax highlighting
;
; Turn on global font-locking
(global-font-lock-mode t)

; Maximum decoration for all modes
(setq font-lock-maximum-decoration t)

(defun my-font-lock-mode-hook()
  ; default comment colour is red ... change to 'tan'
  (set-face-foreground 'font-lock-comment-face' "tan"))
(add-hook 'font-lock-mode-hook 'my-font-lock-mode-hook)

;
; set one particular colour
;
(set-face-foreground 'highlight' "blue")

; ALT+U is undo
(global-set-key "\M-u" 'advertised-undo)

; ALT+L is find-file
(global-set-key "\M-l" 'find-file)

; ALT+S is save-buffer
(global-set-key "\M-s" 'save-buffer)

; ALT+C is compile
(global-set-key "\M-c" 'compile)
; use Gnu make 
(setq compile-command '"gmake -k")

; ALT+N and ALT+P to step through the errors
(global-set-key "\M-n" 'next-error)
(global-set-key "\M-p" 'previous-error)

; ALT+O is other-window
(global-set-key "\M-o" 'other-window)

; ALT+E is end-of-buffer
(global-set-key "\M-e" 'end-of-buffer)

; Ctrl+J is goto-line
(global-set-key "\C-j" 'goto-line)

; ALT+R is search and replace with query
(global-set-key "\M-r" 'query-replace)

; ALT+A is repeat last command
; (within this command, ALT+N, ALT+P (or arrows keys) move to next/previous command)
(global-set-key "\M-a" 'repeat-complex-command)

(setq line-number-mode t)
(display-time)

; hitting enter will automatically indent to the right level
(global-set-key "\C-m" 'newline-and-indent)

;
; f1 maximizes current window
;
(global-set-key [f1] 'delete-other-windows)

;
; F6 switches between buffers
;
(fset 'nextbuffer
   [?\C-x ?b return])
(global-set-key [f6] 'nextbuffer)

;
; F3 shows man page of current function
;
(global-set-key [(f3)] (lambda () (interactive) (manual-entry (current-word))))

;
; F2 shows buffer menu
;
(global-set-key [f2] 'buffer-menu)

;
; Alt+W kills current buffer
;
(fset 'kill_buffer
   [?\C-x ?k return])
(global-set-key "\M-w" 'kill_buffer)

;
; set format of title bar info
;
(setq frame-title-format "%F: %f %+%+")

;
; alt+T inserts the current time + date
;
(defun insert-current-time()
  (interactive)
  (insert (current-time-string))
)
(global-set-key "\M-t" 'insert-current-time)

