How to activate Beancount mode in Emacs?

275 views
Skip to first unread message

Zhang Tianci

unread,
Feb 18, 2021, 10:08:06 PM2/18/21
to Beancount
Thanks in advance to anyone who helps me out!

I am not a programmer and only have very basic programming knowledge, but I love the elegancy of Beancount.
I have Emacs 27 x86_64 installed on my Window computer, now I am completely lost on what to do next.
I have looked at the README of beancount-mode and the documentation of Emacs as well as searched online, but all the instructions make no sense to me. I can't even find the ~/.emacs.d/init.el file in my Emacs directory.
I need basic instruction on how to configure Emacs so that it works with .beancount file.

Sorry for asking such basic question, thanks for any help!!

Ghanashyam Prabhu

unread,
Feb 20, 2021, 12:03:30 AM2/20/21
to bean...@googlegroups.com
You may create the init.el or .emacs file may be created in your 
Linux home directory or .emacs.d directory. Emacs automatically 
searches for the init.el or .emacs file in these directories. 
 
I have the following added to my init.el file, you may refer this
to enable beancount-mode in Emacs

;; beancount setup
;; I cloned the beancount-mode repository to ~/repo/beancount-mode directory
(add-to-list 'load-path "~/repo/beancount-mode/")
(require 'beancount)
(add-to-list 'auto-mode-alist '("\\.beancount\\'" . beancount-mode))

;; beancount outline-minor-mode - enables folding of lines starting with * or ;;;
(add-hook 'beancount-mode-hook #'outline-minor-mode)
(add-hook 'beancount-mode-hook #'linum-on)
(add-hook 'beancount-mode-hook #'column-number-mode)

(define-key beancount-mode-map (kbd "C-c C-n") #'outline-next-visible-heading)
(define-key beancount-mode-map (kbd "C-c C-p") #'outline-previous-visible-heading)

(defun my-enable-beancount-electric-indent
    (setq-local electric-indent-chars t))


/gp

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/99cc8b91-2825-4335-947f-69add3534da8n%40googlegroups.com.

Kang Chan

unread,
Jun 25, 2021, 2:55:37 AM6/25/21
to Beancount
same problem here...

Szabó Tibor

unread,
Jun 25, 2021, 6:58:22 AM6/25/21
to bean...@googlegroups.com
1. Save https://github.com/beancount/beancount-mode/blob/main/beancount.el in C:/Users/<username>/AppData/Roaming/

2. Add to C:/Users/<username>/AppData/ Roaming/.emacs the following 3 lines:

(add-to-list 'load-path "~/")
(require 'beancount)
(add-to-list 'auto-mode-alist '("\\.beancount\\'" . beancount-mode))

That's it.

Regards,
Tibor



--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages