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.

641 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
  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. (org-id-update-id-locations)
  249. #+END_SRC
  250. ** habits
  251. #+BEGIN_SRC emacs-lisp
  252. (require 'org-habit) ;;TODO Lösung ohne require finden, scheint mir nicht ideal zu sein, nur um ein org-modul zu aktivieren
  253. ;; (add-to-list 'org-modules "org-habit")
  254. (setq org-habit-graph-column 80
  255. org-habit-preceding-days 30
  256. org-habit-following-days 7
  257. org-habit-show-habits-only-for-today nil)
  258. #+END_SRC
  259. ** *TODO*
  260. org-super-agenda
  261. ** org-caldav
  262. Vorerst deaktiviert, Nutzen evtl. nicht vorhanden
  263. BEGIN_SRC emacs-lisp
  264. (use-package org-caldav
  265. :ensure t
  266. :config
  267. (setq org-caldav-url "https://nextcloud.cloudsphere.duckdns.org/remote.php/dav/calendars/marc"
  268. org-caldav-calendar-id "orgmode"
  269. org-caldav-inbox (expand-file-name "~/Archiv/Organisieren/caldav-inbox")
  270. org-caldav-files (concat MY--PATH_ORG_FILES "tasks")))
  271. END_SRC
  272. ** journal
  273. [[https://github.com/bastibe/org-journal][Source]]
  274. #+BEGIN_SRC emacs-lisp
  275. (use-package org-journal
  276. :ensure t
  277. :defer t
  278. :custom
  279. (org-journal-dir MY--PATH_ORG_JOURNAl)
  280. (org-journal-enable-agenda-integration t))
  281. #+END_SRC
  282. * ivy / counsel / swiper
  283. #+BEGIN_SRC emacs-lisp
  284. ; (require 'ivy)
  285. (use-package ivy
  286. :ensure t
  287. :diminish
  288. (ivy-mode . "")
  289. :init
  290. (ivy-mode 1)
  291. :bind
  292. ("C-r" . ivy-resume) ;; overrides isearch-backwards binding
  293. :config
  294. (setq ivy-use-virtual-buffers t ;; recent files and bookmarks in ivy-switch-buffer
  295. ivy-height 20 ;; height of ivy window
  296. ivy-count-format "%d/%d" ;; current and total number
  297. ivy-re-builders-alist ;; regex replaces spaces with *
  298. '((t . ivy--regex-plus))))
  299. (use-package counsel
  300. :ensure t
  301. :bind*
  302. (("M-x" . counsel-M-x)
  303. ("C-x C-f" . counsel-find-file)
  304. ("C-x C-r" . counsel-recentf)
  305. ("C-c C-f" . counsel-git)
  306. ("C-c h f" . counsel-describe-function)
  307. ("C-c h v" . counsel-describe-variable)
  308. ("M-i" . counsel-imenu)))
  309. (use-package swiper
  310. :ensure t
  311. :bind
  312. ("C-s" . swiper))
  313. (use-package ivy-hydra
  314. :ensure t)
  315. #+END_SRC
  316. * company
  317. #+BEGIN_SRC emacs-lisp
  318. ; (require 'company)
  319. (use-package company
  320. :defer 1
  321. :bind
  322. (:map company-active-map
  323. ("RET" . nil)
  324. ([return] . nil)
  325. ("TAB" . company-complete-selection)
  326. ([tab] . company-complete-selection)
  327. ("<right>" . company-complete-common))
  328. :config
  329. (global-company-mode 1)
  330. (setq-default
  331. company-idle-delay .2
  332. company-minimum-prefix-length 1
  333. company-require-match nil
  334. company-show-numbers t
  335. company-tooltip-align-annotations t))
  336. ; (require 'company-statistics)
  337. (use-package company-statistics
  338. :ensure t
  339. :after company
  340. :init
  341. (setq company-statistics-file (concat MY--PATH_USER_LOCAL "company-statistics-cache.el"));~/.emacs.d/user-dir/company-statistics-cache.el")
  342. :config
  343. (company-statistics-mode 1))
  344. (use-package company-dabbrev
  345. :ensure nil
  346. :after company
  347. :config
  348. (setq-default company-dabbrev-downcase nil))
  349. (use-package company-box
  350. :ensure t
  351. :init
  352. (add-hook 'company-mode-hook 'company-box-mode))
  353. #+END_SRC
  354. ** company backends
  355. #+BEGIN_SRC emacs-lisp
  356. (defun company/org-mode-hook()
  357. (set (make-local-variable 'company-backends)
  358. '(company-capf company-files))
  359. (add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t)
  360. (message "company/org-mode-hook"))
  361. (defun company/elisp-mode-hook()
  362. (set (make-local-variable 'company-backends)
  363. '((company-elisp company-dabbrev) company-capf company-files))
  364. (message "company/elisp-mode-hook"))
  365. (defun company/beancount-mode-hook()
  366. (set (make-local-variable 'company-backends)
  367. '(company-beancount)))
  368. #+END_SRC
  369. * Programming
  370. ** Magit / Git
  371. Little crash course in magit:
  372. - magit-init to init a git project
  373. - magit-status (C-x g) to call the status window
  374. In status buffer:
  375. - s stage files
  376. - u unstage files
  377. - U unstage all files
  378. - a apply changes to staging
  379. - c c commit (type commit message, then C-c C-c to commit)
  380. - b b switch to another branch
  381. - P u git push
  382. - F u git pull
  383. #+BEGIN_SRC emacs-lisp
  384. (use-package magit
  385. :ensure t
  386. :defer t
  387. :init
  388. ; set git-path in work environment
  389. (if (string-equal user-login-name "POH")
  390. (setq magit-git-executable "P:/Eigene Dateien/Tools/Git/bin/git.exe")
  391. )
  392. :bind (("C-x g" . magit-status))
  393. )
  394. #+END_SRC
  395. ** LSP
  396. Configuration for the language server protocol
  397. *ACHTUNG* Dateipfad muss absolut sein, symlink im Pfad führt zumindest beim ersten Start zu Fehlern beim lsp
  398. Sobald der lsp einmal lief, kann zukünftig der symlink-Pfad genommen werden.
  399. Getestet wurde die funktionierende Datei selbst und neu erstellte Dateien im selben Pfad.
  400. TODO Unterverzeichnisse wurden noch nicht getestet
  401. #+BEGIN_SRC emacs-lisp
  402. (use-package lsp-mode
  403. :defer t
  404. :commands lsp
  405. :custom
  406. (lsp-auto-guess-root nil)
  407. (lsp-prefer-flymake nil) ; use flycheck instead
  408. (lsp-file-watch-threshold 2000)
  409. :bind (:map lsp-mode-map ("C-c C-f" . lsp-format-buffer))
  410. :hook ((python-mode
  411. js-mode
  412. js2-mode
  413. typescript-mode
  414. web-mode) . lsp))
  415. (use-package lsp-ui
  416. :after lsp-mode
  417. :ensure t
  418. :diminish
  419. :commands lsp-ui-mode
  420. :config
  421. (setq lsp-ui-doc-enable t
  422. lsp-ui-doc-header t
  423. lsp-ui-doc-include-signature t
  424. lsp-ui-doc-position 'top
  425. lsp-ui-doc-border (face-foreground 'default)
  426. lsp-ui-sideline-enable nil
  427. lsp-ui-sideline-ignore-duplicate t
  428. lsp-ui-sideline-show-code-actions nil)
  429. (when (display-graphic-p)
  430. (setq lsp-ui-doc-use-webkit t))
  431. ;; workaround hide mode-line of lsp-ui-imenu buffer
  432. (defadvice lsp-ui-imenu (after hide-lsp-ui-imenu-mode-line activate)
  433. (setq mode-line-format nil)))
  434. (use-package company-lsp
  435. :requires company
  436. :defer t
  437. :ensure t
  438. :config
  439. ;;disable client-side cache because lsp server does a better job
  440. (setq company-transformers nil
  441. company-lsp-async t
  442. company-lsp-cache-candidates nil))
  443. #+END_SRC
  444. ** flycheck
  445. #+BEGIN_SRC emacs-lisp
  446. (use-package flycheck
  447. :ensure t
  448. :hook
  449. ((css-mode . flycheck-mode)
  450. (emacs-lisp-mode . flycheck-mode)
  451. (python-mode . flycheck-mode))
  452. :init
  453. (setq flycheck-emacs-lisp-load-path 'inherit)
  454. :config
  455. (setq-default
  456. flycheck-check-synta-automatically '(save mode-enabled)
  457. flycheck-disable-checkers '(emacs-lisp-checkdoc)
  458. eldoc-idle-delay .1 ;; let eldoc echo faster than flycheck
  459. flycheck-display-errors-delay .3)) ;; this way any errors will override eldoc messages
  460. #+END_SRC
  461. ** Projectile
  462. Manage projects and jump quickly between its files
  463. #+BEGIN_SRC emacs-lisp
  464. (use-package projectile
  465. :ensure t
  466. :defer t
  467. :bind
  468. (("C-c p p" . projectile-switch-project)
  469. ("C-c p c" . projectile-command-map)
  470. ("C-c p s s" . projectile-ag))
  471. :init
  472. (setq-default projectile-cache-file (concat MY--PATH_USER_LOCAL ".projectile-cache")
  473. projectile-known-projects-file (concat MY--PATH_USER_LOCAL ".projectile-bookmarks"))
  474. :config
  475. (projectile-mode t)
  476. (setq-default projectile-completion-system 'ivy
  477. projectile-enable-caching t
  478. projectile-mode-line '(:eval (projectile-project-name))))
  479. #+END_SRC
  480. ** lisp
  481. #+BEGIN_SRC emacs-lisp
  482. (add-hook 'emacs-lisp-mode-hook 'company/elisp-mode-hook)
  483. #+END_SRC
  484. ** web
  485. apt install npm
  486. sudo npm install -g vscode-html-languageserver-bin
  487. evtl alternativ typescript-language-server?
  488. #+BEGIN_SRC emacs-lisp
  489. (use-package web-mode
  490. :ensure t
  491. :defer t
  492. :mode
  493. ("\\.phtml\\'"
  494. "\\.tpl\\.php\\'"
  495. "\\.djhtml\\'"
  496. "\\.[t]?html?\\'"))
  497. #+END_SRC
  498. ** Python
  499. Systemseitig muss python-language-server installiert sein:
  500. pip3 install 'python-language-server[all]'
  501. für andere language servers
  502. https://github.com/emacs-lsp/lsp-mode#install-language-server
  503. #+BEGIN_SRC emacs-lisp
  504. (if (string-equal system-type "gnu/linux")
  505. (use-package pyvenv
  506. :ensure t
  507. :config
  508. (setenv "WORKON_HOME" (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/"))
  509. (add-hook 'pyvenv-post-activate-hooks #'my/postactivatehook))
  510. (defun my/postactivatehook ()
  511. (setq lsp-python-ms-extra-paths pyvenv-virtual-env))
  512. (use-package virtualenvwrapper
  513. :ensure t
  514. :hook (venv-postmkvirtualenv . (lambda() (shell-command "pip3 install importmagic epc")))
  515. :config
  516. (setq venv-location (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/")))
  517. (use-package lsp-python-ms
  518. :ensure t
  519. :after lsp-mode python))
  520. ; :custom (lsp-python-executable-cmd "python3"))
  521. #+END_SRC
  522. * beancount
  523. ** Installation
  524. #+BEGIN_SRC shell
  525. sudo su
  526. cd /opt
  527. python3 -m venv beancount
  528. source ./beancount/bin/activate
  529. pip3 install wheel
  530. pip3 install beancount
  531. sleep 100
  532. echo "shell running!"
  533. deactivate
  534. #+END_SRC
  535. #+BEGIN_SRC emacs-lisp
  536. (if (string-equal system-type "gnu/linux")
  537. (use-package beancount
  538. :load-path "user-local/elisp"
  539. ; :ensure t
  540. :defer t
  541. :mode
  542. ("\\.beancount$" . beancount-mode)
  543. :init
  544. (add-hook 'beancount-mode-hook 'company/beancount-mode-hook)
  545. ; (add-hook 'beancount-mode-hook (pyvenv-activate "/opt/beancount"))
  546. ; (setenv "PATH"
  547. ; (concat "/opt/beancount/bin:"
  548. ; (getenv "PATH")))
  549. :config
  550. (setq beancount-filename-main "/home/marc/Archiv/Finanzen/Transaktionen/transactions.beancount")))
  551. #+END_SRC
  552. To support org-babel, check if it can find the symlink to ob-beancount.el
  553. #+BEGIN_SRC shell
  554. orgpath=`find /home/marc/.emacs.d/elpa/ -type d -name "org-plus*" -print`
  555. beansym="$orgpath/ob-beancount.el
  556. bean="/home/marc/Archiv/Programmierprojekte/Lisp/beancount-mode/ob-beancount.el"
  557. if [ -h "$beansym" ]
  558. then
  559. echo "$beansym found"
  560. elif [ -e "$bean" ]
  561. then
  562. echo "creating symlink"
  563. ln -s "$bean" "$beansym"
  564. else
  565. echo "$bean not found, symlink creation aborted"
  566. fi
  567. #+END_SRC
  568. Fava is strongly recommended.
  569. #+BEGIN_SRC shell
  570. cd /opt
  571. python3 -m venv fava
  572. source ./fava/bin/activate
  573. pip3 install wheel
  574. pip3 install fava
  575. deactivate
  576. #+END_SRC
  577. Start fava with fava my_file.beancount
  578. It is accessable on this URL: [[http://127.0.0.1:5000][Fava]]
  579. Beancount-mode can start fava and open the URL right away.