                                nil (ansi-term shell-pop-term-shell))))
 (setq shell-pop-window-position "bottom")
 
+(defun ar/disable-non-prog-minor-modes ()
+  "Disables non-programming minor modes, likely slowing things down."
+  (centered-cursor-mode -1)
+  (linum-mode -1))
+
 ;;  No need for linum under ansi-term, also avoids flickering.
-(add-hook 'term-mode-hook (lambda ()
-                            (centered-cursor-mode -1)
-                            (linum-mode -1)))
+(add-hook 'term-mode-hook #'ar/disable-non-prog-minor-modes)
+(add-hook 'magit-mode-hook #'ar/disable-non-prog-minor-modes)
 
 (global-set-key [f5] 'shell-pop)
 (use-package shell-pop


(setq ring-bell-function 'ignore)

(use-package ido-vertical-mode
  :ensure t)
(ido-vertical-mode)

(use-package markdown-mode+
  :ensure t)
(autoload 'markdown-mode "markdown-mode"


;; Hide dired details by default.
(add-hook 'dired-mode-hook 'dired-hide-details-mode)
;; Use RET instead of "a" in dired.
(define-key dired-mode-map (kbd "RET") 'dired-find-alternate-file)

;; Use ^ in dired to cd to parent.
(defun ar/dired-cd-to-parent ()
  (interactive)
  (find-alternate-file ".."))
(define-key dired-mode-map (kbd "^") 'ar/dired-cd-to-parent)

(defun ar/find-all-dired-current-dir ()
  "Invokes find-dired for current dir."
