Added new open ledger file emacs shortcut "ol"
This commit is contained in:
@@ -226,5 +226,5 @@ Taken from the book /12 Week Year/, the weekly scorecard is a way to measure how
|
|||||||
(insert "\n" table "\n")))))
|
(insert "\n" table "\n")))))
|
||||||
|
|
||||||
(jm/leader-keys
|
(jm/leader-keys
|
||||||
"os" '(jm/scorecard-from-heading :which-key "Open/create yesterday's daily notes file"))
|
"is" '(jm/scorecard-from-heading :which-key "Insert scorecard for current heading."))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
* Ledger CLI
|
* Ledger CLI
|
||||||
|
|
||||||
#+begin_src elisp
|
#+begin_src elisp
|
||||||
|
(defun jm/open-ledger-file ()
|
||||||
|
(interactive)
|
||||||
|
(let* ((year (format-time-string "%Y"))
|
||||||
|
(month (format-time-string "%m"))
|
||||||
|
(ledger-file (expand-file-name
|
||||||
|
(format "Ledger/%s/%s-%s.ledger" year year month)
|
||||||
|
jm/cloud-root)))
|
||||||
|
(find-file ledger-file)))
|
||||||
|
|
||||||
(use-package ledger-mode
|
(use-package ledger-mode
|
||||||
:mode ("\\.ledger\\'")
|
:mode ("\\.ledger\\'")
|
||||||
:config
|
:config
|
||||||
@@ -11,7 +20,9 @@
|
|||||||
'(("bal" "%(binary) -f %(ledger-file) bal")
|
'(("bal" "%(binary) -f %(ledger-file) bal")
|
||||||
("monthly balance" "%(binary) -f %(ledger-file) bal -p 'this month'")
|
("monthly balance" "%(binary) -f %(ledger-file) bal -p 'this month'")
|
||||||
("daily balance" "%(binary) -f %(ledger-file) bal -p 'today'")
|
("daily balance" "%(binary) -f %(ledger-file) bal -p 'today'")
|
||||||
("budget" "%(binary) -f %(ledger-file) --budget -p %(month) bal ^Expenses ^Income")
|
("budget" "%(binary) -f %(ledger-file) -p %(month) budget ^Expenses ^Income")
|
||||||
("account" "%(binary) -f %(ledger-file) reg %(account)")
|
("account" "%(binary) -f %(ledger-file) reg %(account)")
|
||||||
("register" "%(binary) -f %(ledger-file) register"))))
|
("register" "%(binary) -f %(ledger-file) register")))
|
||||||
|
(jm/leader-keys
|
||||||
|
"ol" '(jm/open-ledger-file :which-key "Open ledger file for current month.")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|||||||
Reference in New Issue
Block a user