              (org-cycle)
              (set-window-start nil window-beg))))))
 
-;;;###autoload
-(defun +org/remove-link ()
-  "Unlink the text at point."
-  (interactive)
-  (unless (org-in-regexp org-bracket-link-regexp 1)
-    (user-error "No link at point"))
-  (save-excursion
-    (let ((remove (list (match-beginning 0) (match-end 0)))
-          (description (if (match-end 3)
-                           (match-string-no-properties 3)
-                         (match-string-no-properties 1))))
-      (apply #'delete-region remove)
-      (insert description))))
-
+
+;;
+;; Hooks
+;;
+
+;;;###autoload
+(defun +org|indent-maybe ()
+  "Indent the current item (header or item), if possible. Made for
+`org-tab-first-hook'."
+  (interactive)
+  (cond ((org-at-item-p)
+         (org-indent-item-tree)
+         t)
+        ((org-at-heading-p)
+         (ignore-errors (org-demote))
+         t)
+        ((org-in-src-block-p t)
+         (doom/dumb-indent)
+         t)))
+
+;;;###autoload
+(defun +org|realign-table-maybe ()
+  "Auto-align table under cursor and re-calculate formulas."
+  (when (org-at-table-p)
+    (save-excursion
+      (quiet! (org-table-recalculate)))))
+
+;;;###autoload
+(defun +org|update-cookies ()
+  "Update counts in headlines (aka \"cookies\")."
+  (when (and buffer-file-name (file-exists-p buffer-file-name))
+    (org-update-statistics-cookies t)))
+
+;;;###autoload
+(defun +org|yas-expand-maybe ()
+  "Tries to expand a yasnippet snippet, if one is available. Made for
+`org-tab-first-hook'."
+  (when (and (if (bound-and-true-p evil-mode)
+                 (eq evil-state 'insert)
+               t)
+             (bound-and-true-p yas-minor-mode)
+             (yas--templates-for-key-at-point))
+    (call-interactively #'yas-expand)
+    t))


      (_ (+org/refresh-inline-images)))
    (set-window-start nil scroll-pt)))

;;;###autoload
(defun +org|indent-maybe ()
  "Indent the current item (header or item), if possible. Made for
`org-tab-first-hook'."
  (interactive)
  (cond ((org-at-item-p)
         (org-indent-item-tree)
         t)
        ((org-at-heading-p)
         (ignore-errors (org-demote))
         t)
        ((org-in-src-block-p t)
         (doom/dumb-indent)
         t)))

;;;###autoload
(defun +org|yas-expand-maybe ()
  "Tries to expand a yasnippet snippet, if one is available. Made for
`org-tab-first-hook'."
  (when (and (if (bound-and-true-p evil-mode)
                 (eq evil-state 'insert)
               t)
             (bound-and-true-p yas-minor-mode)
             (yas--templates-for-key-at-point))
    (call-interactively #'yas-expand)
    t))

;;;###autoload
(defun +org/shifttab (&optional arg)
  "An alternative to `org-shifttab' which performs smart indentation if in
insert mode (evil). Otherwise, forwards to the original `org-shifttab'."
  (interactive)
  (cond ((org-at-table-p)
         (call-interactively #'org-table-previous-field))
        ((and (bound-and-true-p evil-mode)
              (evil-insert-state-p))
         (cond ((org-at-item-p)
                (org-list-indent-item-generic
                 -1 nil
                 (save-excursion
                   (when (org-region-active-p)
                     (goto-char (region-beginning)))
                   (org-list-struct))))
               ((org-at-heading-p)
                (ignore-errors (org-promote)))
               (t (call-interactively #'self-insert-command))))
        (t (org-shifttab arg))))

;;;###autoload
(defun +org/insert-item (direction)

   ;; In case the above un-align tables
   (org-table-map-tables 'org-table-align t)))


;;
;; Commands
;;

;;;###autoload
(defun +org/dwim-at-point ()
