   (when (and isearch-forward isearch-other-end)
     (goto-char isearch-other-end)))
 
-;; whitespace
+;;; whitespace
 (setq-default show-trailing-whitespace t)
 (setq whitespace-style '(tabs tab-mark))
 (add-hook 'prog-mode-hook 'whitespace-mode)
 (add-hook 'text-mode-hook 'whitespace-mode)
 
-;; smarter indentation
+;;; smarter indentation
 (global-set-key (kbd "RET") 'newline-and-indent)
 (global-set-key (kbd "C-j") 'newline)
 
-;; dired-mode - enter doesn't open a new buffer
+;;; dired-mode - enter doesn't open a new buffer
 (put 'dired-find-alternate-file 'disabled nil)
 (add-hook 'dired-mode-hook (lambda () (local-set-key (kbd "RET") #'dired-find-alternate-file)))
 
-;; automatically load files as they change on disk
+;;; automatically load files as they change on disk
 (global-auto-revert-mode t)
 
-;; always show row/column numbers
+;;; always show row/column numbers
 (setq column-number-mode t)
 
-;; bm (bookmarks)
+;;; bm (bookmarks)
 (global-set-key (kbd "C-.") 'bm-toggle)
 (global-set-key (kbd "C-,") 'bm-next)
 (setq bm-highlight-style 'bm-highlight-only-fringe)

(setq bm-recenter t)
(setq bm-goto-position nil)

;; smart-tab-mode
(require 'smart-tab)
(setq smart-tab-using-hippie-expand t)
(global-smart-tab-mode 1)
(add-to-list 'smart-tab-disabled-major-modes 'haskell-mode)

;; replace yes-or-no-p with y-or-n-p
(defalias 'yes-or-no-p 'y-or-n-p)

;; flycheck
(add-hook 'after-init-hook #'global-flycheck-mode)
(setq flycheck-indication-mode nil)

;; ido
(setq ido-use-virtual-buffers t)
(ido-ubiquitous-mode t)

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

;; don't show the emacs start screen
(setq inhibit-startup-message t)

;; indicate end of file
(setq default-indicate-empty-lines t)

;; scrolling moves half a window at a time
(defun window-half-height ()
  (/ (window-height (selected-window)) 2))
(global-set-key (kbd "C-v")

  (when (not (package-installed-p p))
    (package-install p)))

;;; Non-package-managed elisp files
(add-to-list 'load-path "~/.emacs.d/lisp/")

(defun smart-open-line ()
