2021-04-13 20:09:08 -04:00
|
|
|
;;; lang/beancount/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
2021-04-15 14:15:42 -04:00
|
|
|
(use-package! beancount
|
2021-05-11 16:20:20 -04:00
|
|
|
:mode ("\\.beancount\\'" . beancount-mode)
|
2021-09-30 01:29:46 +02:00
|
|
|
:hook (beancount-mode . outline-minor-mode)
|
2021-04-13 20:09:08 -04:00
|
|
|
:init
|
2021-09-30 01:29:46 +02:00
|
|
|
;; REVIEW Remove once domtronn/all-the-icons.el#272 is merged
|
2021-04-13 20:09:08 -04:00
|
|
|
(after! all-the-icons
|
|
|
|
(add-to-list 'all-the-icons-icon-alist
|
|
|
|
'("\\.beancount\\'" all-the-icons-material "attach_money" :face all-the-icons-lblue))
|
|
|
|
(add-to-list 'all-the-icons-mode-icon-alist
|
|
|
|
'(beancount-mode all-the-icons-material "attach_money" :face all-the-icons-lblue)))
|
2021-04-15 14:15:42 -04:00
|
|
|
|
2021-04-13 20:09:08 -04:00
|
|
|
:config
|
2021-09-30 01:29:46 +02:00
|
|
|
(setq beancount-electric-currency t)
|
|
|
|
|
2021-04-13 20:09:08 -04:00
|
|
|
(when (featurep! +lsp)
|
|
|
|
(add-hook 'beancount-mode-local-vars-hook #'lsp!))
|
|
|
|
|
|
|
|
(map! :map beancount-mode-map
|
2021-04-15 14:15:42 -04:00
|
|
|
"TAB" (cmds! (and outline-minor-mode (outline-on-heading-p))
|
|
|
|
#'beancount-outline-cycle
|
|
|
|
#'indent-according-to-mode)
|
2021-04-13 20:09:08 -04:00
|
|
|
:localleader
|
|
|
|
"b" #'+beancount/balance
|
|
|
|
"c" #'beancount-check
|
|
|
|
"l" #'beancount-linked
|
|
|
|
"q" #'beancount-query
|
|
|
|
"x" #'beancount-context
|
|
|
|
(:prefix ("i" . "insert")
|
2022-02-09 14:54:49 +01:00
|
|
|
"c" #'+beancount/clone-transaction
|
|
|
|
"C" #'+beancount/clone-this-transaction
|
2021-04-13 20:09:08 -04:00
|
|
|
"a" #'beancount-insert-account
|
|
|
|
"p" #'beancount-insert-prices
|
2021-09-30 14:51:42 +02:00
|
|
|
"d" #'beancount-insert-date)))
|