       (comment-or-uncomment-region (line-beginning-position) (line-end-position))
     (comment-dwim arg)))
 
-(global-set-key (kbd "M-;") 'comment-dwim-line-or-region)
-
-;; Automatically wrap overly long lines for all text modes
-(add-hook 'text-mode-hook #'(lambda () (auto-fill-mode t)))
-
-;; Turn on linum mode for all prog and text modes
-(dolist (hook '(prog-mode-hook text-mode-hook))
-  (add-hook hook #'(lambda () (linum-mode t))))
-;; Renumber the current buffer after reverting the buffer
-(add-hook 'after-revert-hook 'linum-update-current)
-
-;; lisp keybindings
-(global-set-key (kbd "C-c e f") 'byte-compile-file)
-(define-key emacs-lisp-mode-map (kbd "C-c e e") 'eval-last-sexp)
-(define-key emacs-lisp-mode-map (kbd "C-c e r") 'eval-region)
-(define-key emacs-lisp-mode-map (kbd "C-c e b") 'eval-buffer)
-(define-key emacs-lisp-mode-map (kbd "C-c e c") 'emacs-lisp-byte-compile)
-(define-key emacs-lisp-mode-map (kbd "C-c e l") 'emacs-lisp-byte-compile-and-load)
-(define-key emacs-lisp-mode-map (kbd "C-c e d") 'byte-recompile-directory)
-(define-key emacs-lisp-mode-map (kbd "C-c e g") 'find-function-at-point)
-(define-key emacs-lisp-mode-map (kbd "C-c e v") 'find-variable-at-point)
-(add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
-
-;; Rebind windmove keys
-(global-set-key (kbd "C-c <left>")  'windmove-left)
-(global-set-key (kbd "C-c <right>") 'windmove-right)
-(global-set-key (kbd "C-c <up>")    'windmove-up)
-(global-set-key (kbd "C-c <down>")  'windmove-down)
-
-;; Replace default buffer menu with ibuffer
-(global-set-key (kbd "C-x C-b") 'ibuffer)
-
-;; Unmap undo-tree mode
+
+(use-package bind-key
+  :bind (
+         ("M-;" . comment-dwim-line-or-region)
+         ;; Rebind windmove keys
+         ("C-c <left>"  . windmove-left)
+         ("C-c <right>" . windmove-right)
+         ("C-c <up>"    . windmove-up)
+         ("C-c <down>"  . windmove-down)
+         ;; Replace default buffer menu with ibuffer
+         ("C-x C-b"     . ibuffer)
+         ;; Rebind undo to undo-tree visualizer
+         ("C-x u"       . undo-tree-visualize)
+         ("C-c e f"     . byte-compile-file)
+         :emacs-lisp-mode-map
+         ("C-c e e"     . eval-last-sexp)
+         ("C-c e e"     . eval-last-sexp)
+         ("C-c e r"     . eval-region)
+         ("C-c e b"     . eval-buffer)
+         ("C-c e c"     . emacs-lisp-byte-compile)
+         ("C-c e l"     . emacs-lisp-byte-compile-and-load)
+         ("C-c e d"     . byte-recompile-directory)
+         ("C-c e g"     . find-function-at-point)
+         ("C-c e v"     . find-variable-at-point))
+  :config (add-hook 'emacs-lisp-mode-hook 'eldoc-mode))
+
+;; Unmap extraneous undo-tree mode keys
 (assq-delete-all 'undo-tree-mode minor-mode-map-alist)
-(global-set-key (kbd "C-x u") 'undo-tree-visualize)
 
 ;; Unbind hide/show mode's ridiculous keybindings
 (assq-delete-all 'hs-minor-mode minor-mode-map-alist)


;; No more yes and no and y and n inconsistencies
(fset 'yes-or-no-p 'y-or-n-p)

;; More sensible comment-dwim
(defun comment-dwim-line-or-region (&optional arg)


;; yasnippet
(use-package yasnippet
  :bind (:map yas-minor-mode-map
              ("TAB"   . nil)
              ("<tab>" . nil)
              ("C-c i" . yas-expand))
  :config (dolist (hook '(prog-mode-hook text-mode))
            (add-hook hook 'yas-minor-mode)
            (yas-reload-all)))

;; Window management
(use-package golden-ratio
