feat(beancount): add {next,previous}-transaction commands
This commit is contained in:
parent
6471690782
commit
9d9b278914
2 changed files with 16 additions and 0 deletions
|
@ -164,3 +164,17 @@ Updates the date to today"
|
||||||
(delete-blank-lines)
|
(delete-blank-lines)
|
||||||
(beancount-insert-date)
|
(beancount-insert-date)
|
||||||
(insert transaction)))))
|
(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)))
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
"TAB" (cmds! (and outline-minor-mode (outline-on-heading-p))
|
"TAB" (cmds! (and outline-minor-mode (outline-on-heading-p))
|
||||||
#'beancount-outline-cycle
|
#'beancount-outline-cycle
|
||||||
#'indent-according-to-mode)
|
#'indent-according-to-mode)
|
||||||
|
:m "[[" #'+beancount/previous-transaction
|
||||||
|
:m "]]" #'+beancount/next-transaction
|
||||||
:localleader
|
:localleader
|
||||||
"b" #'+beancount/balance
|
"b" #'+beancount/balance
|
||||||
"c" #'beancount-check
|
"c" #'beancount-check
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue