       (mkdir doom-scratch-files-dir t))
     (with-current-buffer
         (if project-p
-            (find-file-noselect (expand-file-name (replace-regexp-in-string "\\." "_" (projectile-project-name) t t)
-                                                  doom-scratch-files-dir)
-                                nil t)
+            (find-file-noselect
+             (expand-file-name (replace-regexp-in-string
+                                "\\." "_" (projectile-project-name)
+                                t t)
+                               doom-scratch-files-dir)
+             nil t)
           (get-buffer-create "*doom:scratch*"))
       (when project-p
         (rename-buffer (format "*doom:scratch (%s)*" (projectile-project-name))))

  (interactive)
  (if indent-tabs-mode
      (call-interactively #'backward-delete-char)
    (save-excursion
      (unless (looking-back "^[\s\t]*" (line-beginning-position))
        (doom--goto-first-non-blank))
      (let* ((movement (% (current-column) tab-width))
             (spaces (if (= 0 movement) tab-width (- tab-width movement))))
        (delete-char (- spaces))))))

;;;###autoload
(defun doom/backward-kill-to-bol-and-indent ()
  "Kill line to the first non-blank character. If invoked again
afterwards, kill line to column 1."
  (interactive)
  (let ((empty-line (save-excursion (beginning-of-line) (looking-at-p "[ \t]*$"))))
    (funcall (if (featurep 'evil) #'evil-delete #'delete-region)
             (point-at-bol) (point))
    (unless empty-line
      (indent-according-to-mode))))

;;;###autoload

  (cond ((sp-point-in-string)
         (newline))
        ((sp-point-in-comment)
         (pcase major-mode
           ((or 'js2-mode 'rjsx-mode)
            (call-interactively #'js2-line-break))
           ((or 'java-mode 'php-mode)
            (c-indent-new-comment-line))
           ((or 'c-mode 'c++-mode 'objc-mode 'css-mode 'scss-mode 'js2-mode)
            (newline-and-indent)
            (insert "* ")
            (indent-according-to-mode))
           (_
            ;; Fix an off-by-one cursor-positioning issue
            ;; with `indent-new-comment-line'
            (let ((col (save-excursion (comment-beginning) (current-column))))
              (indent-new-comment-line)
              (unless (= col (current-column))
                (insert " "))))))
        (t
         (newline nil t)
         (indent-according-to-mode))))
