From fde2a115d88865cbe5329c8828c13e18adc96197 Mon Sep 17 00:00:00 2001 From: Ryan Kes <> Date: Mon, 6 Jul 2020 17:06:40 +0200 Subject: [PATCH] added stuff to make life easier with org-roam --- emacs/.config/doom/configuration.org | 23 ++++++++++++++++++++++- emacs/.config/doom/init.el | 3 ++- emacs/.config/doom/packages.el | 1 + emacs/.local/bin/viewDotfile | 18 ++++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100755 emacs/.local/bin/viewDotfile diff --git a/emacs/.config/doom/configuration.org b/emacs/.config/doom/configuration.org index 76abf5a..24ba2d4 100644 --- a/emacs/.config/doom/configuration.org +++ b/emacs/.config/doom/configuration.org @@ -3,6 +3,7 @@ - [[#variable-font-sizes-depending-on-screen-width-set-font-to-jetbrains-mono][Variable font sizes depending on screen width. Set font to JetBrains Mono]] - [[#theme-is-set-to-doom-molokai-from-doom-themes][Theme is set to doom-molokai from doom-themes]] - [[#fetch-password-from-authinfo][Fetch password from authinfo]] + - [[#set-relative-line-numbers][Set relative line numbers]] - [[#projectile][Projectile]] - [[#set-default-paths-projectile-should-search][Set default paths projectile should search]] - [[#circe][Circe]] @@ -19,8 +20,10 @@ - [[#capture-web-data-for-org-protocol-capture-html][Capture web data for org-protocol-capture-html]] - [[#org-roam][org-roam]] - [[#set-directory][Set directory]] + - [[#set-org-roam-viewer][Set org-roam-viewer]] - [[#org-journal][org-journal]] - [[#get-org-journal-to-work-nicely-with-org-roam][Get org-journal to work nicely with org-roam]] + - [[#publishing][Publishing]] - [[#mu4e][mu4e]] - [[#setup-mu4e-with-multiple-profiles][Setup mu4e with multiple profiles]] - [[#elfeed][Elfeed]] @@ -57,6 +60,10 @@ secret)) (error "Password not found for %S" params)))) #+END_SRC +** Set relative line numbers +#+BEGIN_SRC emacs-lisp +(setq display-line-numbers-type `relative) +#+END_SRC * [[https://www.projectile.mx/en/latest/][Projectile]] ** Set default paths [[https://www.projectile.mx/en/latest/][projectile]] should search #+BEGIN_SRC emacs-lisp @@ -140,13 +147,27 @@ #+BEGIN_SRC emacs-lisp (setq org-roam-directory "~/Documents/org-roam") #+END_SRC +*** Set org-roam-viewer +#+BEGIN_SRC emacs-lisp +(setq org-roam-graph-viewer "~/.local/bin/viewDotfile") +#+END_SRC ** [[https://github.com/bastibe/org-journal][org-journal]] *** Get org-journal to work nicely with org-roam #+BEGIN_SRC emacs-lisp (setq org-journal-dir "~/Documents/org-roam") (setq org-journal-date-prefix "#+title: ") (setq org-journal-file-format "%Y-%m-%d.org") -(setq org-journal-date-format "%A, %d %B %Y")) +(setq org-journal-date-format "%A, %d %B %Y") +#+END_SRC +** Publishing +#+BEGIN_SRC emacs-lisp +(setq org-publish-project-alist + '(("wiki" + :base-directory "~/Documents/org-roam/" + :publishing-directory "~/devel/personal/Ryankes.eu/wiki/content/" + :publishing-function org-pandoc-export-to-markdown_mmd + :select-tags ("export-blog") + ))) #+END_SRC * [[https://www.djcbsoftware.nl/code/mu/mu4e.html][mu4e]] ** Setup mu4e with multiple profiles diff --git a/emacs/.config/doom/init.el b/emacs/.config/doom/init.el index a95fd7c..f4898d3 100644 --- a/emacs/.config/doom/init.el +++ b/emacs/.config/doom/init.el @@ -58,6 +58,7 @@ grammar :tools + biblio docker editorconfig ; let someone else argue about tabs vs spaces (eval +overlay) ; run code, run (also, repls) @@ -82,7 +83,7 @@ +journal +roam +dragndrop ; drag & drop files/images into org buffers - +pandoc ; export-with-pandoc support + +pandoc +present) ; using org-mode for presentations (php +lsp) ; perl's insecure younger brother diff --git a/emacs/.config/doom/packages.el b/emacs/.config/doom/packages.el index ee80f21..b1ec0b5 100644 --- a/emacs/.config/doom/packages.el +++ b/emacs/.config/doom/packages.el @@ -13,3 +13,4 @@ (package! fish-mode) (package! salt-mode) (package! fountain-mode) +(package! org-ref) diff --git a/emacs/.local/bin/viewDotfile b/emacs/.local/bin/viewDotfile new file mode 100755 index 0000000..2c07e61 --- /dev/null +++ b/emacs/.local/bin/viewDotfile @@ -0,0 +1,18 @@ +#!/bin/bash + +# Check if parameter is passed +if [ ! $# -eq 1 ]; then + echo "Error: no parameter passed!" + exit 1 +else + # Check if a valid dot file is passed + if [[ $1 = /tmp/graph*.dot ]]; then + # Check that file exists + if [[ -f $1 ]]; then + dot -T pdf <"$1" | zathura - && rm "$1" + else + echo "File $1 doesn't exist!" + exit 1 + fi + fi +fi