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.

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