    ;; Whitespace
    tab-width 2
    indent-tabs-mode nil
+
+   ;; Return to last edit position
+   save-place-file saveplacefile
 
    ;; Persistent undo
    undo-tree-auto-save-history t

;; Settings
(let
    ((backupdir (concat user-emacs-directory "backups/"))
     (undodir (concat user-emacs-directory "undo/")))

  ;; Make required directories
  (mapc

(or (file-exists-p package-user-dir) (package-refresh-contents))

;; Helper to install and require
(defun pkg (p)
  (unless (require p nil t)
    (package-install p)
    (require p)))

(progn (pkg 'mouse)
       (xterm-mouse-mode t)
       (global-set-key [mouse-4] (lambda ()
				   (interactive)
				   (scroll-down 1)))
       (global-set-key [mouse-5] (lambda ()
				   (interactive)
				   (scroll-up 1)))
       (defun track-mouse (e))
       (setq mouse-sel-mode t))

(progn (pkg 'saveplace)
       (setq-default save-place t))

(progn (pkg 'evil)
       (evil-mode 1)

       ;; Keep Vim ctrl-u
       (define-key evil-normal-state-map (kbd "C-u") 'evil-scroll-up)

       ;; Swap ; and :
       (define-key evil-normal-state-map (kbd ";") 'evil-ex)
       (define-key evil-normal-state-map (kbd ":") 'evil-repeat-find-char)

       ;; Backtab = jump backwards
       (define-key evil-normal-state-map (kbd "<backtab>") 'evil-jump-backward)

       ;; Preserve visual mode
       (defun evil-shift-left-visual ()
	 (interactive)
	 (evil-shift-left (region-beginning) (region-end))
	 (evil-normal-state)
	 (evil-visual-restore))

       (defun evil-shift-right-visual ()
	 (interactive)
	 (evil-shift-right (region-beginning) (region-end))
	 (evil-normal-state)
	 (evil-visual-restore))

       (define-key evil-visual-state-map (kbd ">") 'evil-shift-right-visual)
       (define-key evil-visual-state-map (kbd "<") 'evil-shift-left-visual)

       (progn (pkg 'evil-leader)
	      (global-evil-leader-mode)
	      (evil-leader/set-leader "<SPC>"))

       (progn (pkg 'evil-surround)
	      (global-evil-surround-mode 1))

       (progn (pkg 'evil-mc)
	      (global-evil-mc-mode 1)))

(progn (pkg 'helm)
       (progn (pkg 'helm-config)
	      (helm-mode 1))

       ;; Replace keybinds with helm equivalents
       (global-set-key (kbd "M-x") 'helm-M-x)
       (global-set-key (kbd "C-x r b") 'helm-filtered-bookmarks)
       (global-set-key (kbd "C-x C-f") 'helm-find-files)

       ;; Fuzzy all the things
       (setq
	helm-mode-fuzzy-match t
	helm-completion-in-region-fuzzy-match t
	helm-recentf-fuzzy-match t
	helm-buffers-fuzzy-matching t
	helm-recentf-fuzzy-match t
	helm-buffers-fuzzy-matching t
	helm-locate-fuzzy-match t
	helm-M-x-fuzzy-match t
	helm-semantic-fuzzy-match t
	helm-imenu-fuzzy-match t
	helm-apropos-fuzzy-match t
	helm-lisp-fuzzy-completion t))

(progn (pkg 'auto-complete)
       (setq ac-delay 1
	     ac-quick-help-delay 1
	     ac-auto-show-menu t)
       (global-set-key (kbd "<backtab>") 'ac-previous)
       (ac-config-default))

(progn (pkg 'smart-mode-line)
       (setq
	sml/no-confirm-load-theme t
	sml/theme 'respectful)
       (sml/setup))

(progn (pkg 'git-gutter)
       (global-git-gutter-mode t)
       (git-gutter:linum-setup))

(progn (pkg 'rainbow-delimiters)
       (add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode))

;; General
(menu-bar-mode -1) ;; Disable toolbar
