hledger: Make config even more lean and actually working
It does remove some features, but I'd rather have this whole thing working right now, than anything else
This commit is contained in:
parent
9dba19c6e8
commit
1480134eab
1 changed files with 2 additions and 37 deletions
|
@ -1170,15 +1170,6 @@ When Emacs is opened in Windows Subsystem for Linux, open web links in Firefox o
|
|||
(hledger-next-or-new-entry)
|
||||
(hledger-pulse-momentary-current-entry))
|
||||
|
||||
(defface hledger-warning-face
|
||||
'((((background dark))
|
||||
:background "Red" :foreground "White")
|
||||
(((background light))
|
||||
:background "Red" :foreground "White")
|
||||
(t :inverse-video t))
|
||||
"Face for warning"
|
||||
:group 'hledger)
|
||||
|
||||
(defun hledger/prev-entry ()
|
||||
"Move to last entry and pulse."
|
||||
(interactive)
|
||||
|
@ -1205,36 +1196,13 @@ When Emacs is opened in Windows Subsystem for Linux, open web links in Firefox o
|
|||
|
||||
:config
|
||||
(add-hook 'hledger-view-mode-hook #'hl-line-mode)
|
||||
(add-hook 'hledger-view-mode-hook #'center-text-for-reading)
|
||||
|
||||
(add-hook 'hledger-view-mode-hook
|
||||
(lambda ()
|
||||
(run-with-timer 1
|
||||
nil
|
||||
(lambda ()
|
||||
(when (equal hledger-last-run-command
|
||||
"balancesheet")
|
||||
;; highlight frequently changing accounts
|
||||
(highlight-regexp "^.*\\(savings\\|cash\\).*$")
|
||||
(highlight-regexp "^.*credit-card.*$"
|
||||
'hledger-warning-face))))))
|
||||
|
||||
(add-hook 'hledger-mode-hook
|
||||
(lambda ()
|
||||
(make-local-variable 'company-backends)
|
||||
(add-to-list 'company-backends 'hledger-company))))
|
||||
|
||||
(use-package! hledger-input
|
||||
:commands (hledger-capture popup-balance-at-point)
|
||||
:preface
|
||||
(defun popup-balance-at-point ()
|
||||
"Show balance for account at point in a popup."
|
||||
(interactive)
|
||||
(if-let ((account (thing-at-point 'hledger-account)))
|
||||
(message (hledger-shell-command-to-string (format " balance -N %s "
|
||||
account)))
|
||||
(message "No account at point")))
|
||||
|
||||
:commands (hledger-capture)
|
||||
:init
|
||||
(setq hledger-jfile
|
||||
(expand-file-name "~/org/fin/hledger.journal"))
|
||||
|
@ -1242,10 +1210,7 @@ When Emacs is opened in Windows Subsystem for Linux, open web links in Firefox o
|
|||
(:map global-map
|
||||
:leader
|
||||
(:desc "hledger"
|
||||
:g "0" #'hledger-capture))
|
||||
(:map hledger-input-mode-map
|
||||
:localleader
|
||||
:desc "balance" "b" #'popup-balance-at-point))
|
||||
:g "0" #'hledger-capture)))
|
||||
|
||||
:config
|
||||
(setq hledger-input-buffer-height 20)
|
||||
|
|
Reference in a new issue