diff --git a/modules/lang/beancount/autoload.el b/modules/lang/beancount/autoload.el index 09a513d4d..2d9c41a9f 100644 --- a/modules/lang/beancount/autoload.el +++ b/modules/lang/beancount/autoload.el @@ -164,3 +164,17 @@ Updates the date to today" (delete-blank-lines) (beancount-insert-date) (insert transaction))))) + +;;;###autoload +(defun +beancount/next-transaction (&optional count) + "Jump to the start of the next COUNT-th transaction." + (interactive "p") + (dotimes (_ (or count 1)) + (beancount-goto-next-transaction))) + +;;;###autoload +(defun +beancount/previous-transaction (&optional count) + "Jump to the start of current or previous COUNT-th transaction." + (interactive "p") + (re-search-backward + beancount-transaction-regexp nil t (or count 1))) diff --git a/modules/lang/beancount/config.el b/modules/lang/beancount/config.el index c70ce6f7d..19261c366 100644 --- a/modules/lang/beancount/config.el +++ b/modules/lang/beancount/config.el @@ -21,6 +21,8 @@ "TAB" (cmds! (and outline-minor-mode (outline-on-heading-p)) #'beancount-outline-cycle #'indent-according-to-mode) + :m "[[" #'+beancount/previous-transaction + :m "]]" #'+beancount/next-transaction :localleader "b" #'+beancount/balance "c" #'beancount-check