 
 ;; yasnippet
 (use-package yasnippet
-  :config (progn
-            (add-hook 'yas-minor-mode-hook
-                      #'(lambda ()
-                          (define-key yas-minor-mode-map (kbd "TAB") nil)
-                          (define-key yas-minor-mode-map (kbd "<tab>") nil)
-                          (define-key yas-minor-mode-map (kbd "C-c i") 'yas-expand)))
-            ;; Turn on yasnippet for all prog and text modes
-            (dolist (hook '(prog-mode-hook text-mode))
-              (add-hook hook 'yas-minor-mode)
-              (yas-reload-all))))
+  :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

      (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
(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)

                :config (python-docstring-mode))

              (use-package py-isort
                :bind (:map python-mode-map
                            ("C-c s" . py-isort-buffer)))

              (use-package pyenv-mode-auto)

