2015-02-10 02:48:40 +00:00
|
|
|
;;; packages.el --- Finance Layer packages File for Spacemacs
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2015-02-10 02:48:40 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-04-19 03:40:24 +00:00
|
|
|
(setq finance-packages
|
2015-02-10 02:48:40 +00:00
|
|
|
'(
|
2015-04-09 03:57:22 +00:00
|
|
|
company
|
2017-07-03 07:52:54 +00:00
|
|
|
(flycheck-ledger :requires flycheck)
|
2015-02-10 02:48:40 +00:00
|
|
|
ledger-mode
|
2015-04-19 03:40:24 +00:00
|
|
|
))
|
2015-02-10 02:48:40 +00:00
|
|
|
|
2017-01-02 05:39:04 +00:00
|
|
|
(defun finance/post-init-company ()
|
|
|
|
(spacemacs|add-company-backends
|
|
|
|
:backends company-capf
|
|
|
|
:modes ledger-mode))
|
2015-02-10 02:48:40 +00:00
|
|
|
|
2016-05-30 02:39:21 +00:00
|
|
|
(defun finance/init-flycheck-ledger ()
|
|
|
|
(with-eval-after-load 'flycheck
|
|
|
|
(require 'flycheck-ledger)))
|
2015-02-10 02:48:40 +00:00
|
|
|
|
|
|
|
(defun finance/init-ledger-mode ()
|
|
|
|
(use-package ledger-mode
|
|
|
|
:mode ("\\.\\(ledger\\|ldg\\)\\'" . ledger-mode)
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq ledger-post-amount-alignment-column 62)
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'ledger-mode
|
2015-11-23 20:01:32 +00:00
|
|
|
"hd" 'ledger-delete-current-transaction
|
|
|
|
"a" 'ledger-add-transaction
|
|
|
|
"b" 'ledger-post-edit-amount
|
|
|
|
"c" 'ledger-toggle-current
|
|
|
|
"C" 'ledger-mode-clean-buffer
|
|
|
|
"l" 'ledger-display-ledger-stats
|
|
|
|
"p" 'ledger-display-balance-at-point
|
|
|
|
"q" 'ledger-post-align-xact
|
|
|
|
"r" 'ledger-reconcile
|
|
|
|
"R" 'ledger-report
|
|
|
|
"t" 'ledger-insert-effective-date
|
|
|
|
"y" 'ledger-set-year
|
|
|
|
"RET" 'ledger-set-month)
|
2017-01-04 10:15:39 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'ledger-reconcile-mode
|
2017-01-05 05:57:46 +00:00
|
|
|
(or dotspacemacs-major-mode-leader-key ",") 'ledger-reconcile-toggle
|
2017-01-04 10:15:39 +00:00
|
|
|
"a" 'ledger-reconcile-add
|
|
|
|
"q" 'ledger-reconcile-quit
|
|
|
|
"t" 'ledger-reconcile-change-target
|
|
|
|
"RET" 'ledger-reconcile-finish)
|
2016-01-04 14:17:07 +00:00
|
|
|
;; temporary hack to work-around an issue with evil-define-key
|
2017-02-02 08:54:33 +00:00
|
|
|
;; more info: https://github.com/emacs-evil/evil/issues/301
|
2016-01-04 14:17:07 +00:00
|
|
|
;; TODO remove this hack if the limitation is removed upstream
|
|
|
|
(add-hook 'ledger-mode-hook 'evil-normalize-keymaps)
|
2015-11-21 10:07:14 +00:00
|
|
|
(evilified-state-evilify ledger-report-mode ledger-report-mode-map))))
|