summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
authorAlan Pearce2019-11-19 23:16:27 +0100
committerAlan Pearce2019-11-19 23:16:27 +0100
commit1078600d993baaf585d91a476f0d03c992817518 (patch)
treecf9f8e541a59d716c9398bb27c98f9a34b5810cd /user
parent38a8873c6514889a5500d59e20ec58e984dafd8a (diff)
downloadnixfiles-1078600d993baaf585d91a476f0d03c992817518.tar.lz
nixfiles-1078600d993baaf585d91a476f0d03c992817518.tar.zst
nixfiles-1078600d993baaf585d91a476f0d03c992817518.zip
Emacs: setup ledger and evil-ledger
Diffstat (limited to 'user')
-rw-r--r--user/emacs/.emacs.d/init.el18
-rw-r--r--user/settings/emacs.nix1
2 files changed, 19 insertions, 0 deletions
diff --git a/user/emacs/.emacs.d/init.el b/user/emacs/.emacs.d/init.el
index d535aa51..fbdcb402 100644
--- a/user/emacs/.emacs.d/init.el
+++ b/user/emacs/.emacs.d/init.el
@@ -696,6 +696,24 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
 (use-package beancount
   :load-path "~/projects/bitbucket.org/blais/beancount/editors/emacs")
 
+;;;; ledger
+
+(use-package ledger-mode
+  :config (progn
+            (setq ledger-reconcile-default-commodity "€"
+                  ledger-narrow-on-reconcile t
+                  ledger-reports `(("Monthly Expenses" "ledger -f %(ledger-file) reg -M \\^Flex --real -X EUR -l \"payee != 'Opening Balances'\"")
+                                   ("Average Monthly Expenses (Past 12 Months)" ,(concat "ledger -f %(ledger-file) -b "
+                                                                                    (format-time-string "%Y-%m" (time-add (current-time) (days-to-time -365)))
+                                                                                    " --monthly --average balance ^Flex"))
+                                   ("Expenses:This Month" "ledger -f %(ledger-file) bal \\^Flex -p \"this month\"")
+                                   ("All Account Balances" "ledger -f %(ledger-file) bal --current -R \\^Assets \\^Liabilities")))))
+
+
+(use-package evil-ledger
+  :after ledger-mode
+  :ghook '(ledger-mode-hook))
+
 ;;;; org
 
 (custom-set-variables '(org-ellipsis "…")
diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix
index 2e43606c..4b3fed1a 100644
--- a/user/settings/emacs.nix
+++ b/user/settings/emacs.nix
@@ -68,6 +68,7 @@ in
       evil
       evil-collection
       evil-commentary
+      evil-ledger
       evil-magit
       evil-mu4e
       evil-org