     (setenv "PATH" path-from-shell)
     (setq exec-path (split-string path-from-shell path-separator))))
 
-(when window-system (set-exec-path-from-PATH)) ; Only set the path when run in windowed mode (not necessary in shell)
+(when window-system (set-exec-path-from-env)) ; Only set the path when run in windowed mode (not necessary in shell)
+
+;; Tune Emacs GC (This is mostly to speed up flx-ido)
+(setq gc-cons-threshold 20000000) ; Set emacs to run GC every 20MB allocated (default is .76MB)
 
 ;; Set default font
-(set-face-attribute 'default t :font "Anonymous Pro-12")
+(add-to-list 'default-frame-alist '(font . "Anonymous Pro-12"))
+
+;; Inhibit startup message
+(setq inhibit-startup-message t)
 
 ;; Move backups to a central location and tuning
 (setq backup-directory-alist `(("." . "~/.emacs-saves")))

(package-initialize)

;; Set exec-path from PATH
(defun set-exec-path-from-PATH ()
  "Set the 'exec-path' variable to include the $PATH from the shell when in windowed mode."
  (let ((path-from-shell (replace-regexp-in-string
			  "[ \t\n]*$"

  ; Godef jump key binding
  (local-set-key (kbd "C-g j") 'godef-jump))

;; Go Autocomplete
(use-package go-autocomplete
  :load-path "go")
  
;; Flycheck
(use-package flycheck
  :ensure t
  :config
  (add-hook 'after-init-hook #'global-flycheck-mode)
  (setq-default flycheck-emacs-lisp-load-path 'inherit) ; Inherit the loadpath for elisp checks
  (defvar flycheck-check-syntax-automatically '(mode-enabled save)))
  
;; Rainbow Delimiters
(use-package rainbow-delimiters
  :ensure t
  :config
  (add-hook 'prog-mode-hook #'rainbow-delimiters-mode))

;; Smex
(use-package smex
  :ensure t
  :init
  (smex-initialize)
  :config
  (global-set-key (kbd "M-x") 'smex)
  (global-set-key (kbd "M-X") 'smex-major-mode-commands)
  (global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)) ; Old M-x
  
;; Flx-Ido Mode
(use-package flx-ido
  :ensure t
  :functions ido-everywhere
  :init
  (ido-mode 1)
  (ido-everywhere 1)
  (flx-ido-mode 1)
  (setq ido-enable-flex-matching t)
  (setq ido-use-faces nil)) ; disble ido faces to see flx highlights


;; Auto-complete mode
(use-package auto-complete
  :ensure t
  :init
  (ac-config-default))

;; Disable bell for certain circumstances
(defun intelligent-bell ()
  "Disable the bell for certain common and personally unwanted circumstances."
  (unless (memq this-command
		'(isearch-abort
		  abort-recursive-edit
		  exit-minibuffer
		  keyboard-quit
		  mwheel-scroll
		  down
		  up
		  next-line
		  previous-line
		  backward-char
		  forward-char))
    (ding)))
(setq ring-bell-function 'intelligent-bell)

