You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

642 lines
19 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. #+TITLE: Emacs configuration file
  2. #+AUTHOR: Marc
  3. #+BABEL: :cache yes
  4. #+PROPERTY: header-args :tangle yes
  5. * TODOS
  6. - Paket exec-path-from-shell, um PATH aus Linux auch in emacs zu haben
  7. - Smart mode line?
  8. - Theme
  9. - evil-collection or custom in init file?
  10. - Hydra
  11. - General
  12. - (defalias 'list-buffers 'ibuffer) ;; change default to ibuffer
  13. - ido?
  14. - treemacs (for linux)
  15. - treemacs-evil?
  16. - treemacs-projectile
  17. - ace-window
  18. - windmove?
  19. - tramp (in linux)
  20. - visual-regexp
  21. - org configuration: paths
  22. - org custom agenda
  23. - org configuration: everything else
  24. - beancount configuration from config.org
  25. - CONTINUE TODO from config.org at Programming
  26. * First start
  27. When pulling the repository the first time, an initial init.el needs to be setup. After start it will replace itself with the configuration from init.org
  28. #+BEGIN_SRC emacs-lisp :tangle no
  29. (require 'org')
  30. (find-file (concat user-emacs-directory "init.org"))
  31. (org-babel-tangle)
  32. (load-file (concat user-emacs-directory "init.el"))
  33. (byte-compile-file (concat user-emacs-directory "init.el"))
  34. #+END_SRC
  35. This function updates init.el whenever changes in init.org are made. The update will be active after saving.
  36. #+BEGIN_SRC emacs-lisp
  37. (defun me/tangle-init ()
  38. "If the current buffer is 'init.org',
  39. the code blocks are tangled, and the tangled file is compiled."
  40. (when (equal (buffer-file-name)
  41. (expand-file-name (concat user-emacs-directory "init.org")))
  42. ;; avoid running hooks
  43. (let ((prog-mode-hook nil))
  44. (org-babel-tangle)
  45. (byte-compile-file (concat user-emacs-directory "init.el"))
  46. (load-file user-init-file))))
  47. (add-hook 'after-save-hook 'me/tangle-init)
  48. #+END_SRC
  49. #+BEGIN_SRC emacs-lisp
  50. (require 'package)
  51. ;; bug before emacs 26.3
  52. (when (version< emacs-version "26.3")
  53. (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
  54. (add-to-list 'package-archives '("elpa" . "https://elpa.gnu.org/packages/") t)
  55. (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
  56. (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
  57. (add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
  58. (package-initialize)
  59. #+END_SRC
  60. #+BEGIN_SRC emacs-lisp
  61. (unless (package-installed-p 'use-package)
  62. (package-refresh-contents)
  63. (package-install 'use-package))
  64. (setq use-package-verbose nil)
  65. (eval-when-compile
  66. (require 'use-package))
  67. (require 'bind-key)
  68. (use-package diminish
  69. :ensure t)
  70. #+END_SRC
  71. * Default settings
  72. #+BEGIN_SRC emacs-lisp
  73. (defvar me/whoami
  74. (if (string-equal (system-name) "PMTS01")
  75. "work_remote"
  76. (if (string-equal (system-name) "laptop")
  77. "home_laptop"
  78. (if (string-equal (system-name) "PMPCNEU08")
  79. "work_local"
  80. "home_desktop"))))
  81. #+END_SRC
  82. #+BEGIN_SRC emacs-lisp
  83. (defvar MY--PATH_USER_LOCAL (expand-file-name "~/.emacs.d/user-local/"))
  84. (defvar MY--PATH_USER_GLOBAL (expand-file-name "~/.emacs.d/user-global/"))
  85. (defvar MY--PATH_ORG_FILES (expand-file-name "~/Archiv/Organisieren/"))
  86. (defvar MY--PATH_ORG_FILES_MOBILE (expand-file-name "~/Archiv/Organisieren/mobile/"))
  87. (defvar MY--PATH_ORG_JOURNAl (expand-file-name "~/Archiv/Organisieren/Journal/"))
  88. (setq bookmark-default-file (concat MY--PATH_USER_LOCAL "bookmarks"))
  89. (setq recentf-save-file (concat MY--PATH_USER_LOCAL "recentf"))
  90. (setq custom-file (concat MY--PATH_USER_LOCAL "custom.el")) ;; don't spam init.e with saved customization settings
  91. (setq abbrev-file-name (concat MY--PATH_USER_GLOBAL "abbrev_defs"))
  92. (setq backup-directory-alist `((".*" . ,temporary-file-directory)))
  93. (setq auto-save-file-name-transforms `((".*" ,temporary-file-directory)))
  94. (setq save-abbrevs 'silently) ;; don't bother me with asking for abbrev saving
  95. (setq-default create-lockfiles nil) ;; disable lock files, can cause trouble in e.g. lsp-mode
  96. (defalias 'yes-or-no-p 'y-or-n-p) ;; answer with y and n
  97. (setq custom-safe-themes t) ;; don't ask me if I want to load a theme
  98. (setq sentence-end-double-space nil) ;; don't coun two spaces after a period as the end of a sentence.
  99. (delete-selection-mode t) ;; delete selected region when typing
  100. (save-place-mode 1) ;; saves position in file when it's closed
  101. (setq save-place-forget-unreadable-files nil) ;; checks if file is readable before saving position
  102. (setq locale-coding-system 'utf-8)
  103. (set-terminal-coding-system 'utf-8)
  104. (set-keyboard-coding-system 'utf-8)
  105. (set-selection-coding-system 'utf-8)
  106. (if (eq system-type 'windows-nt)
  107. (prefer-coding-system 'utf-8-dos)
  108. (prefer-coding-system 'utf-8))
  109. (blink-cursor-mode -1) ;; turn off blinking cursor
  110. (show-paren-mode t) ;; show other part of brackets
  111. (column-number-mode t)
  112. (setq uniquify-buffer-name-style 'forward)
  113. (setq-default indent-tabs-mode nil) ;; avoid tabs in place of multiple spaces (they look bad in tex)
  114. (setq-default indicate-empty-lines t) ;; show empty lines
  115. (setq scroll-margin 5 ;; smooth scrolling
  116. scroll-conservatively 10000
  117. scroll-preserve-screen-position 1
  118. scroll-step 1)
  119. (global-hl-line-mode t) ;; highlight current line
  120. (menu-bar-mode 0) ;; disable menu bar
  121. (tool-bar-mode 0) ;; disable tool bar
  122. (scroll-bar-mode 0) ;; disable scroll bar
  123. #+END_SRC
  124. Some windows specific stuff
  125. #+BEGIN_SRC emacs-lisp
  126. (when (eq system-type 'windows-nt)
  127. (remove-hook 'find-file-hooks 'vc-refresh-state)
  128. (progn
  129. (setq gc-cons-threshold (* 511 1024 1024)
  130. gc-cons-percentage 0.5
  131. garbage-collection-messages t
  132. w32-pipe-read-delay 0
  133. w32-get-true-file-attributes nil)
  134. (run-with-idle-timer 5 t #'garbage-collect)))
  135. #+END_SRC
  136. * visuals
  137. ** Font
  138. #+BEGIN_SRC emacs-lisp
  139. (if (string-equal system-type "gnu/linux")
  140. (set-face-font 'default "Hack-10"))
  141. #+END_SRC
  142. ** line wrappings
  143. #+BEGIN_SRC emacs-lisp
  144. (global-visual-line-mode)
  145. (diminish 'visual-line-mode)
  146. (use-package adaptive-wrap
  147. :ensure t
  148. :config
  149. (add-hook 'visual-line-mode-hook #'adaptive-wrap-prefix-mode))
  150. ; :init
  151. ; (when (fboundp 'adaptive-wrap-prefix-mode)
  152. ; (defun my/activate-adaptive-wrap-prefix-mode ()
  153. ; "Toggle `visual-line-mode' and `adaptive-wrap-prefix-mode' simultaneously."
  154. ; (adaptive-wrap-prefix-mode (if visual-line-mode 1 -1)))
  155. ; (add-hook 'visual-line-mode-hook 'my/activate-adaptive-wrap-prefix-mode)))
  156. #+END_SRC
  157. ** line numbers
  158. #+BEGIN_SRC emacs-lisp
  159. (use-package display-line-numbers
  160. :init
  161. (add-hook 'prog-mode-hook 'display-line-numbers-mode)
  162. (add-hook 'org-src-mode-hook 'display-line-numbers-mode)
  163. :config
  164. (setq-default display-line-numbers-type 'visual
  165. display-line-numbers-current-absolute t
  166. display-line-numbers-with 4
  167. display-line-numbers-widen t))
  168. ; (add-hook 'emacs-lisp-mode-hook 'display-line-numbers-mode)
  169. #+END_SRC
  170. ** misc
  171. #+BEGIN_SRC emacs-lisp
  172. (use-package rainbow-mode
  173. :ensure t
  174. :diminish
  175. :hook ((org-mode
  176. emacs-lisp-mode) . rainbow-mode))
  177. #+END_SRC
  178. * undo
  179. #+BEGIN_SRC emacs-lisp
  180. (use-package undo-tree
  181. :ensure t
  182. :diminish undo-tree-mode
  183. :init
  184. (global-undo-tree-mode 1))
  185. #+END_SRC
  186. * imenu-list
  187. A minor mode to show imenu in a sidebar.
  188. Call imenu-list-smart-toggle.
  189. [[https://github.com/bmag/imenu-list][Source]]
  190. #+BEGIN_SRC emacs-lisp
  191. (use-package imenu-list
  192. :ensure t
  193. :config
  194. (setq imenu-list-focus-after-activation t
  195. imenu-list-auto-resize t
  196. imenu-list-position 'right)
  197. :bind
  198. (:map global-map
  199. ([f9] . imenu-list-smart-toggle))
  200. )
  201. #+END_SRC
  202. * which-key
  203. #+BEGIN_SRC emacs-lisp
  204. (use-package which-key
  205. :ensure t
  206. :diminish which-key-mode
  207. :config
  208. (which-key-mode)
  209. (which-key-setup-side-window-right-bottom)
  210. (which-key-setup-minibuffer)
  211. (setq which-key-idle-delay 0.5))
  212. #+END_SRC
  213. * Evil
  214. #+BEGIN_SRC emacs-lisp
  215. (use-package evil
  216. :ensure t
  217. :defer .1 ;; don't block emacs when starting, load evil immediately after startup
  218. :config
  219. (evil-mode 1))
  220. #+END_SRC
  221. * General (key mapper)
  222. #+BEGIN_SRC emacs-lisp
  223. (use-package general
  224. :ensure t)
  225. (general-define-key
  226. :states 'normal
  227. :keymaps 'imenu-list-major-mode-map
  228. (kbd "RET") '(imenu-list-goto-entry :which-key "goto")
  229. (kbd "TAB") '(hs-toggle-hiding :which-key "collapse")
  230. "d" '(imenu-list-display-entry :which-key "show")
  231. "q" '(imenu-list-quit-window :which-key "quit"))
  232. #+END_SRC
  233. * orgmode
  234. ** org
  235. #+BEGIN_SRC emacs-lisp
  236. (use-package org
  237. :ensure org-plus-contrib
  238. :init
  239. (add-hook 'org-mode-hook 'company/org-mode-hook)
  240. :config
  241. ;; (require 'org-id)
  242. (add-to-list 'org-modules "org-id")
  243. (setq org-default-notes-file (concat MY--PATH_ORG_FILES "notes.org")
  244. org-agenda-files (list MY--PATH_ORG_FILES
  245. MY--PATH_ORG_FILES_MOBILE)
  246. org-id-locations-file (concat MY--PATH_USER_LOCAL ".org-id-locations")
  247. org-log-into-drawer "LOGBOOK")
  248. (setq org-src-window-setup 'current-window)) ;; C-c ' opens in current window
  249. (org-id-update-id-locations)
  250. #+END_SRC
  251. ** habits
  252. #+BEGIN_SRC emacs-lisp
  253. (require 'org-habit) ;;TODO Lösung ohne require finden, scheint mir nicht ideal zu sein, nur um ein org-modul zu aktivieren
  254. ;; (add-to-list 'org-modules "org-habit")
  255. (setq org-habit-graph-column 80
  256. org-habit-preceding-days 30
  257. org-habit-following-days 7
  258. org-habit-show-habits-only-for-today nil)
  259. #+END_SRC
  260. ** *TODO*
  261. org-super-agenda
  262. ** org-caldav
  263. Vorerst deaktiviert, Nutzen evtl. nicht vorhanden
  264. BEGIN_SRC emacs-lisp
  265. (use-package org-caldav
  266. :ensure t
  267. :config
  268. (setq org-caldav-url "https://nextcloud.cloudsphere.duckdns.org/remote.php/dav/calendars/marc"
  269. org-caldav-calendar-id "orgmode"
  270. org-caldav-inbox (expand-file-name "~/Archiv/Organisieren/caldav-inbox")
  271. org-caldav-files (concat MY--PATH_ORG_FILES "tasks")))
  272. END_SRC
  273. ** journal
  274. [[https://github.com/bastibe/org-journal][Source]]
  275. #+BEGIN_SRC emacs-lisp
  276. (use-package org-journal
  277. :ensure t
  278. :defer t
  279. :custom
  280. (org-journal-dir MY--PATH_ORG_JOURNAl)
  281. (org-journal-enable-agenda-integration t))
  282. #+END_SRC
  283. * ivy / counsel / swiper
  284. #+BEGIN_SRC emacs-lisp
  285. ; (require 'ivy)
  286. (use-package ivy
  287. :ensure t
  288. :diminish
  289. (ivy-mode . "")
  290. :init
  291. (ivy-mode 1)
  292. :bind
  293. ("C-r" . ivy-resume) ;; overrides isearch-backwards binding
  294. :config
  295. (setq ivy-use-virtual-buffers t ;; recent files and bookmarks in ivy-switch-buffer
  296. ivy-height 20 ;; height of ivy window
  297. ivy-count-format "%d/%d" ;; current and total number
  298. ivy-re-builders-alist ;; regex replaces spaces with *
  299. '((t . ivy--regex-plus))))
  300. (use-package counsel
  301. :ensure t
  302. :bind*
  303. (("M-x" . counsel-M-x)
  304. ("C-x C-f" . counsel-find-file)
  305. ("C-x C-r" . counsel-recentf)
  306. ("C-c C-f" . counsel-git)
  307. ("C-c h f" . counsel-describe-function)
  308. ("C-c h v" . counsel-describe-variable)
  309. ("M-i" . counsel-imenu)))
  310. (use-package swiper
  311. :ensure t
  312. :bind
  313. ("C-s" . swiper))
  314. (use-package ivy-hydra
  315. :ensure t)
  316. #+END_SRC
  317. * company
  318. #+BEGIN_SRC emacs-lisp
  319. ; (require 'company)
  320. (use-package company
  321. :defer 1
  322. :bind
  323. (:map company-active-map
  324. ("RET" . nil)
  325. ([return] . nil)
  326. ("TAB" . company-complete-selection)
  327. ([tab] . company-complete-selection)
  328. ("<right>" . company-complete-common))
  329. :config
  330. (global-company-mode 1)
  331. (setq-default
  332. company-idle-delay .2
  333. company-minimum-prefix-length 1
  334. company-require-match nil
  335. company-show-numbers t
  336. company-tooltip-align-annotations t))
  337. ; (require 'company-statistics)
  338. (use-package company-statistics
  339. :ensure t
  340. :after company
  341. :init
  342. (setq company-statistics-file (concat MY--PATH_USER_LOCAL "company-statistics-cache.el"));~/.emacs.d/user-dir/company-statistics-cache.el")
  343. :config
  344. (company-statistics-mode 1))
  345. (use-package company-dabbrev
  346. :ensure nil
  347. :after company
  348. :config
  349. (setq-default company-dabbrev-downcase nil))
  350. (use-package company-box
  351. :ensure t
  352. :init
  353. (add-hook 'company-mode-hook 'company-box-mode))
  354. #+END_SRC
  355. ** company backends
  356. #+BEGIN_SRC emacs-lisp
  357. (defun company/org-mode-hook()
  358. (set (make-local-variable 'company-backends)
  359. '(company-capf company-files))
  360. (add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t)
  361. (message "company/org-mode-hook"))
  362. (defun company/elisp-mode-hook()
  363. (set (make-local-variable 'company-backends)
  364. '((company-elisp company-dabbrev) company-capf company-files))
  365. (message "company/elisp-mode-hook"))
  366. (defun company/beancount-mode-hook()
  367. (set (make-local-variable 'company-backends)
  368. '(company-beancount)))
  369. #+END_SRC
  370. * Programming
  371. ** Magit / Git
  372. Little crash course in magit:
  373. - magit-init to init a git project
  374. - magit-status (C-x g) to call the status window
  375. In status buffer:
  376. - s stage files
  377. - u unstage files
  378. - U unstage all files
  379. - a apply changes to staging
  380. - c c commit (type commit message, then C-c C-c to commit)
  381. - b b switch to another branch
  382. - P u git push
  383. - F u git pull
  384. #+BEGIN_SRC emacs-lisp
  385. (use-package magit
  386. :ensure t
  387. :defer t
  388. :init
  389. ; set git-path in work environment
  390. (if (string-equal user-login-name "POH")
  391. (setq magit-git-executable "P:/Eigene Dateien/Tools/Git/bin/git.exe")
  392. )
  393. :bind (("C-x g" . magit-status))
  394. )
  395. #+END_SRC
  396. ** LSP
  397. Configuration for the language server protocol
  398. *ACHTUNG* Dateipfad muss absolut sein, symlink im Pfad führt zumindest beim ersten Start zu Fehlern beim lsp
  399. Sobald der lsp einmal lief, kann zukünftig der symlink-Pfad genommen werden.
  400. Getestet wurde die funktionierende Datei selbst und neu erstellte Dateien im selben Pfad.
  401. TODO Unterverzeichnisse wurden noch nicht getestet
  402. #+BEGIN_SRC emacs-lisp
  403. (use-package lsp-mode
  404. :defer t
  405. :commands lsp
  406. :custom
  407. (lsp-auto-guess-root nil)
  408. (lsp-prefer-flymake nil) ; use flycheck instead
  409. (lsp-file-watch-threshold 2000)
  410. :bind (:map lsp-mode-map ("C-c C-f" . lsp-format-buffer))
  411. :hook ((python-mode
  412. js-mode
  413. js2-mode
  414. typescript-mode
  415. web-mode) . lsp))
  416. (use-package lsp-ui
  417. :after lsp-mode
  418. :ensure t
  419. :diminish
  420. :commands lsp-ui-mode
  421. :config
  422. (setq lsp-ui-doc-enable t
  423. lsp-ui-doc-header t
  424. lsp-ui-doc-include-signature t
  425. lsp-ui-doc-position 'top
  426. lsp-ui-doc-border (face-foreground 'default)
  427. lsp-ui-sideline-enable nil
  428. lsp-ui-sideline-ignore-duplicate t
  429. lsp-ui-sideline-show-code-actions nil)
  430. (when (display-graphic-p)
  431. (setq lsp-ui-doc-use-webkit t))
  432. ;; workaround hide mode-line of lsp-ui-imenu buffer
  433. (defadvice lsp-ui-imenu (after hide-lsp-ui-imenu-mode-line activate)
  434. (setq mode-line-format nil)))
  435. (use-package company-lsp
  436. :requires company
  437. :defer t
  438. :ensure t
  439. :config
  440. ;;disable client-side cache because lsp server does a better job
  441. (setq company-transformers nil
  442. company-lsp-async t
  443. company-lsp-cache-candidates nil))
  444. #+END_SRC
  445. ** flycheck
  446. #+BEGIN_SRC emacs-lisp
  447. (use-package flycheck
  448. :ensure t
  449. :hook
  450. ((css-mode . flycheck-mode)
  451. (emacs-lisp-mode . flycheck-mode)
  452. (python-mode . flycheck-mode))
  453. :init
  454. (setq flycheck-emacs-lisp-load-path 'inherit)
  455. :config
  456. (setq-default
  457. flycheck-check-synta-automatically '(save mode-enabled)
  458. flycheck-disable-checkers '(emacs-lisp-checkdoc)
  459. eldoc-idle-delay .1 ;; let eldoc echo faster than flycheck
  460. flycheck-display-errors-delay .3)) ;; this way any errors will override eldoc messages
  461. #+END_SRC
  462. ** Projectile
  463. Manage projects and jump quickly between its files
  464. #+BEGIN_SRC emacs-lisp
  465. (use-package projectile
  466. :ensure t
  467. :defer t
  468. :bind
  469. (("C-c p p" . projectile-switch-project)
  470. ("C-c p c" . projectile-command-map)
  471. ("C-c p s s" . projectile-ag))
  472. :init
  473. (setq-default projectile-cache-file (concat MY--PATH_USER_LOCAL ".projectile-cache")
  474. projectile-known-projects-file (concat MY--PATH_USER_LOCAL ".projectile-bookmarks"))
  475. :config
  476. (projectile-mode t)
  477. (setq-default projectile-completion-system 'ivy
  478. projectile-enable-caching t
  479. projectile-mode-line '(:eval (projectile-project-name))))
  480. #+END_SRC
  481. ** lisp
  482. #+BEGIN_SRC emacs-lisp
  483. (add-hook 'emacs-lisp-mode-hook 'company/elisp-mode-hook)
  484. #+END_SRC
  485. ** web
  486. apt install npm
  487. sudo npm install -g vscode-html-languageserver-bin
  488. evtl alternativ typescript-language-server?
  489. #+BEGIN_SRC emacs-lisp
  490. (use-package web-mode
  491. :ensure t
  492. :defer t
  493. :mode
  494. ("\\.phtml\\'"
  495. "\\.tpl\\.php\\'"
  496. "\\.djhtml\\'"
  497. "\\.[t]?html?\\'"))
  498. #+END_SRC
  499. ** Python
  500. Systemseitig muss python-language-server installiert sein:
  501. pip3 install 'python-language-server[all]'
  502. für andere language servers
  503. https://github.com/emacs-lsp/lsp-mode#install-language-server
  504. #+BEGIN_SRC emacs-lisp
  505. (if (string-equal system-type "gnu/linux")
  506. (use-package pyvenv
  507. :ensure t
  508. :config
  509. (setenv "WORKON_HOME" (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/"))
  510. (add-hook 'pyvenv-post-activate-hooks #'my/postactivatehook))
  511. (defun my/postactivatehook ()
  512. (setq lsp-python-ms-extra-paths pyvenv-virtual-env))
  513. (use-package virtualenvwrapper
  514. :ensure t
  515. :hook (venv-postmkvirtualenv . (lambda() (shell-command "pip3 install importmagic epc")))
  516. :config
  517. (setq venv-location (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/")))
  518. (use-package lsp-python-ms
  519. :ensure t
  520. :after lsp-mode python))
  521. ; :custom (lsp-python-executable-cmd "python3"))
  522. #+END_SRC
  523. * beancount
  524. ** Installation
  525. #+BEGIN_SRC shell
  526. sudo su
  527. cd /opt
  528. python3 -m venv beancount
  529. source ./beancount/bin/activate
  530. pip3 install wheel
  531. pip3 install beancount
  532. sleep 100
  533. echo "shell running!"
  534. deactivate
  535. #+END_SRC
  536. #+BEGIN_SRC emacs-lisp
  537. (if (string-equal system-type "gnu/linux")
  538. (use-package beancount
  539. :load-path "user-local/elisp"
  540. ; :ensure t
  541. :defer t
  542. :mode
  543. ("\\.beancount$" . beancount-mode)
  544. :init
  545. (add-hook 'beancount-mode-hook 'company/beancount-mode-hook)
  546. ; (add-hook 'beancount-mode-hook (pyvenv-activate "/opt/beancount"))
  547. ; (setenv "PATH"
  548. ; (concat "/opt/beancount/bin:"
  549. ; (getenv "PATH")))
  550. :config
  551. (setq beancount-filename-main "/home/marc/Archiv/Finanzen/Transaktionen/transactions.beancount")))
  552. #+END_SRC
  553. To support org-babel, check if it can find the symlink to ob-beancount.el
  554. #+BEGIN_SRC shell
  555. orgpath=`find /home/marc/.emacs.d/elpa/ -type d -name "org-plus*" -print`
  556. beansym="$orgpath/ob-beancount.el
  557. bean="/home/marc/Archiv/Programmierprojekte/Lisp/beancount-mode/ob-beancount.el"
  558. if [ -h "$beansym" ]
  559. then
  560. echo "$beansym found"
  561. elif [ -e "$bean" ]
  562. then
  563. echo "creating symlink"
  564. ln -s "$bean" "$beansym"
  565. else
  566. echo "$bean not found, symlink creation aborted"
  567. fi
  568. #+END_SRC
  569. Fava is strongly recommended.
  570. #+BEGIN_SRC shell
  571. cd /opt
  572. python3 -m venv fava
  573. source ./fava/bin/activate
  574. pip3 install wheel
  575. pip3 install fava
  576. deactivate
  577. #+END_SRC
  578. Start fava with fava my_file.beancount
  579. It is accessable on this URL: [[http://127.0.0.1:5000][Fava]]
  580. Beancount-mode can start fava and open the URL right away.