From 82d66af51b9ae6d1ba843f86df41bf6e9f707ca5 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Wed, 14 Jul 2021 21:57:02 +0300 Subject: [PATCH] feat(emacs): org-journal --- .emacs.d/init.el | 39 ++++++++++++++++++++++++++++++++++++--- Emacs.org | 20 +++++++++++++++++++- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 8214810..c0a7f64 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1027,7 +1027,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." (require 'org-crypt) (org-crypt-use-before-save-magic) (setq org-tags-exclude-from-inheritance (quote ("crypt"))) - (setq org-crypt-key nil) + (setq org-crypt-key "C1EC867E478472439CC82410DE004F32AFA00205") (use-package jupyter :straight t :init @@ -1145,7 +1145,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." (require 'org-crypt) (org-crypt-use-before-save-magic) (setq org-tags-exclude-from-inheritance (quote ("crypt"))) -(setq org-crypt-key nil) +(setq org-crypt-key "C1EC867E478472439CC82410DE004F32AFA00205") (use-package org-contrib :straight (org-contrib @@ -1307,6 +1307,20 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." (setq org-refile-targets '(("projects.org" :maxlevel . 2))) +(use-package org-journal + :straight t + :config + (setq org-journal-dir "~/Documents/org-mode/journal/") + (setq org-journal-file-type 'weekly) + (setq org-journal-file-format "%Y-%m-%d.org") + (setq org-journal-enable-encryption t)) + +(my-leader-def + :infix "aj" + "j" 'org-journal-new-entry + "o" 'org-journal-open-current-journal-file + "s" 'org-journal-search) + (use-package org-latex-impatient :straight (:repo "yangsheng6810/org-latex-impatient" :branch "master" @@ -2267,7 +2281,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." :if (not my/slow-ssh) :hook (python-mode . (lambda () (require 'lsp-pyright) - (setq-local lsp-python-ms-python-executable (my/get-pipenv-python)) + (setq-local lsp-pyright-python-executable (my/get-pipenv-python)) (lsp)))) (add-hook 'python-mode-hook #'smartparens-mode) @@ -2550,6 +2564,25 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." (when link (eww link)))) +(use-package tldr + :straight t + :commands (tldr) + :config + (setq tldr-source-zip-url "https://github.com/tldr-pages/tldr/archive/refs/heads/main.zip") + + (defun tldr-update-docs () + (interactive) + (shell-command-to-string (format "curl -L %s --output %s" tldr-source-zip-url tldr-saved-zip-path)) + (when (file-exists-p "/tmp/tldr") + (delete-directory "/tmp/tldr" t)) + (shell-command-to-string (format "unzip -d /tmp/tldr/ %s" tldr-saved-zip-path) nil nil) + (when (file-exists-p tldr-directory-path) + (delete-directory tldr-directory-path 'recursive 'no-trash)) + (shell-command-to-string (format "mv %s %s" "/tmp/tldr/tldr-main" tldr-directory-path)))) + +(my-leader-def "hT" 'tldr) +(my-leader-def "hM" 'man) + (my-leader-def "ai" #'erc-tls) (use-package erc-hl-nicks diff --git a/Emacs.org b/Emacs.org index 15c03b8..aebcb7a 100644 --- a/Emacs.org +++ b/Emacs.org @@ -1817,7 +1817,7 @@ Use the built-in org mode. (require 'org-crypt) (org-crypt-use-before-save-magic) (setq org-tags-exclude-from-inheritance (quote ("crypt"))) -(setq org-crypt-key nil) +(setq org-crypt-key "C1EC867E478472439CC82410DE004F32AFA00205") #+end_src *** org-contrib =org-contrib= is a package with various additions to Org. I use the following: @@ -2131,6 +2131,24 @@ Settings for Org capture mode. The goal here is to have a non-disruptive process "/Received on/ %:date-timestamp-inactive")))) #+end_src +*** Org Journal +A plugin for maintaining journal in org mode. I want to have its entries separate from my potential knowledge database. + +#+begin_src emacs-lisp +(use-package org-journal + :straight t + :config + (setq org-journal-dir "~/Documents/org-mode/journal/") + (setq org-journal-file-type 'weekly) + (setq org-journal-file-format "%Y-%m-%d.org") + (setq org-journal-enable-encryption t)) + +(my-leader-def + :infix "aj" + "j" 'org-journal-new-entry + "o" 'org-journal-open-current-journal-file + "s" 'org-journal-search) +#+end_src ** UI *** OFF (OFF) Instant equations preview Instant math previews for org mode.