  delete-trailing-lines nil
  fill-column 80
  sentence-end-double-space nil
+ word-wrap t
  ;; Scrolling
  hscroll-margin 1
  hscroll-step 1

 ;; Wrapping
 truncate-lines t
 truncate-partial-width-windows 50
 visual-fill-column-center-text nil
 word-wrap t
 vc-follow-symlinks t)

;; Ediff: use existing frame instead of creating a new one
(add-hook! ediff-load
  (setq ediff-diff-options           "-w"
        ediff-split-window-function  #'split-window-horizontally
        ediff-window-setup-function  #'ediff-setup-windows-plain)) ; no extra frames

;; revert buffers for changed files
(global-auto-revert-mode 1)
(setq auto-revert-verbose nil)

;; don't kill scratch buffers
(defun doom|dont-kill-scratch-buffer ()
  (or (not (string= (buffer-name) "*scratch*"))
      (ignore (bury-buffer))))
(add-hook 'kill-buffer-query-functions #'doom|dont-kill-scratch-buffer)

;; enabled by default in Emacs 25+. No thanks.
(electric-indent-mode -1)

(defun doom*delete-trailing-whitespace (orig-fn &rest args)
  "Don't affect trailing whitespace on current line."

  (add-hook! 'editorconfig-custom-hooks
    (if indent-tabs-mode (whitespace-mode +1))))

;; Auto-close delimiters and blocks as you type
(def-package! smartparens
  :demand t
  :init
  (setq sp-autowrap-region nil ; let evil-surround handle this
        sp-highlight-pair-overlay nil
