   (interactive)
   (if (and delete-selection-mode transient-mark-mode mark-active)
       (setq deactivate-mark  t)
-    (when (get-buffer "*Completions*") (delete-windows-on "*Completions*"))
+    (when (get-buffer "*Completions*")
+      (delete-windows-on "*Completions*"))
     (abort-recursive-edit)))
 
 (define-key evil-normal-state-map [escape] 'keyboard-quit)

(define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit)
(global-set-key [escape] 'evil-exit-emacs-state)

(define-key evil-normal-state-map (kbd "C-k") (lambda () (interactive)
                                                (evil-scroll-up nil)))
(define-key evil-normal-state-map (kbd "C-j") (lambda () (interactive)
                                                (evil-scroll-down nil)))

;; 2 spaces for tabs
(setq-default tab-width 2 indent-tabs-mode nil)

(add-hook 'org-mode-hook 'turn-on-flyspell)

;; Load agenda files if they exist.
;; Credit: [StackOverflow] how-to-make-all-org-files-under-a-folder-added-in-agenda-list-automatically
(when (file-exists-p "~/.emacs.d/agenda")
  (load-library "find-lisp")
  (setq org-agenda-files (find-lisp-find-files "~/.emacs.d/agenda" "\.org$")))
