2015-02-10 02:48:40 +00:00
|
|
|
;;; packages.el --- Finance Layer packages File for Spacemacs
|
|
|
|
;;
|
2016-01-12 02:40:54 +00:00
|
|
|
;; Copyright (c) 2012-2016 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
|
2016-05-30 02:39:21 +00:00
|
|
|
(flycheck-ledger :toggle (configuration-layer/package-usedp '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
|
|
|
|
|
|
|
|
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-04-30 03:54:30 +00:00
|
|
|
(push 'company-capf company-backends-ledger-mode)
|
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)
|
2016-01-04 14:17:07 +00:00
|
|
|
;; temporary hack to work-around an issue with evil-define-key
|
|
|
|
;; more info: https://bitbucket.org/lyro/evil/issues/301/evil-define-key-for-minor-mode-does-not
|
|
|
|
;; 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))))
|
2015-04-07 20:02:53 +00:00
|
|
|
|
2016-05-30 02:39:21 +00:00
|
|
|
(defun finance/post-init-company ()
|
|
|
|
(spacemacs|add-company-hook ledger-mode))
|