       (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)
  (doom/sudo-find-file (file-truename buffer-file-name)))

(defun doom--goto-first-non-blank ()
  (beginning-of-visual-line)
  (skip-chars-forward " \t\r"))

;;;###autoload
(defun doom/backward-to-bol-or-indent ()
  "Move back to the current line's indentation. If already there, move to the
beginning of the line instead. If at bol, do nothing."
  (interactive)
  (let ((boi (save-excursion (back-to-indentation) (point)))
        (point (point)))
    (if (= boi point)
        (beginning-of-visual-line)
      (unless (= (line-beginning-position) point)
        (doom--goto-first-non-blank)))))

;;;###autoload
(defun doom/forward-to-last-non-comment-or-eol ()

             (save-match-data
               (if (string-match "\\w*\\(\\s-+\\)$"
                                 (buffer-substring-no-properties (max (point-min) (- p movement)) p))
                   (sp-delete-char
                    (- 0 (- (match-end 1)
                            (match-beginning 1))))
                 (call-interactively delete-backward-char)))))

          ;; Otherwise do a regular delete
