mirror of
https://github.com/foo-dogsquared/dotfiles.git
synced 2025-01-31 04:57:57 +00:00
Update Emacs config again
This commit is contained in:
parent
de6b66c657
commit
932a81aa81
@ -2,10 +2,6 @@
|
|||||||
|
|
||||||
;; Place your private configuration here! Remember, you do not need to run 'doom
|
;; Place your private configuration here! Remember, you do not need to run 'doom
|
||||||
;; sync' after modifying this file!
|
;; sync' after modifying this file!
|
||||||
|
|
||||||
|
|
||||||
;; Some functionality uses this to identify you, e.g. GPG configuration, email
|
|
||||||
;; clients, file templates and snippets.
|
|
||||||
(setq user-full-name "Gabriel Arazas"
|
(setq user-full-name "Gabriel Arazas"
|
||||||
user-mail-address "foo.dogsquared@gmail.com")
|
user-mail-address "foo.dogsquared@gmail.com")
|
||||||
|
|
||||||
@ -18,32 +14,40 @@
|
|||||||
org-roam-directory "~/writings/wiki"
|
org-roam-directory "~/writings/wiki"
|
||||||
org-roam-dailies-directory (f-join org-roam-directory "daily"))
|
org-roam-dailies-directory (f-join org-roam-directory "daily"))
|
||||||
|
|
||||||
;; This determines the style of line numbers in effect. If set to `nil', line
|
|
||||||
;; numbers are disabled. For relative line numbers, set this to `relative'.
|
|
||||||
(setq global-display-line-numbers-mode t)
|
(setq global-display-line-numbers-mode t)
|
||||||
(setq display-line-numbers-type 'relative)
|
(setq display-line-numbers-type 'relative)
|
||||||
|
|
||||||
;; Here are some additional functions/macros that could help you configure Doom:
|
|
||||||
;;
|
|
||||||
;; - `load!' for loading external *.el files relative to this one
|
|
||||||
;; - `use-package' for configuring packages
|
|
||||||
;; - `after!' for running code after a package has loaded
|
|
||||||
;; - `add-load-path!' for adding directories to the `load-path', relative to
|
|
||||||
;; this file. Emacs searches the `load-path' when you load packages with
|
|
||||||
;; `require' or `use-package'.
|
|
||||||
;; - `map!' for binding new keys
|
|
||||||
;;
|
|
||||||
;; To get information about any of these functions/macros, move the cursor over
|
|
||||||
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c g k').
|
|
||||||
;; This will open documentation for it, including demos of how they are used.
|
|
||||||
;;
|
|
||||||
;; You can also try 'gd' (or 'C-c g d') to jump to their definition and see how
|
|
||||||
;; they are implemented.
|
|
||||||
|
|
||||||
;; Search the project path with Projectile.
|
|
||||||
(setq projectile-project-search-path '("~/projects/software/" "~/writings/"))
|
(setq projectile-project-search-path '("~/projects/software/" "~/writings/"))
|
||||||
|
|
||||||
; Set the TeX engine to LuaTeX.
|
(setq
|
||||||
|
time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S %:z"
|
||||||
|
org-id-link-to-org-use-id t
|
||||||
|
|
||||||
|
+file-templates-dir (expand-file-name "templates" doom-private-dir)
|
||||||
|
+wiki-directory "~/writings/wiki"
|
||||||
|
|
||||||
|
org-journal-dir "~/writings/journal"
|
||||||
|
org-journal-file-format "%F"
|
||||||
|
|
||||||
|
enable-local-variables "query")
|
||||||
|
|
||||||
|
(defvar my/wiki-asset-directory-name "assets")
|
||||||
|
|
||||||
|
(defun align-non-space (BEG END)
|
||||||
|
"Align non-space columns in region BEG END."
|
||||||
|
(interactive "r")
|
||||||
|
(align-regexp BEG END "\\(\\s-*\\)\\S-+" 1 1 t))
|
||||||
|
|
||||||
|
(defun my/create-assets-folder ()
|
||||||
|
"A quick convenient function to create an assets folder in the wiki folder."
|
||||||
|
(interactive)
|
||||||
|
(if (and (not (string= (f-base (buffer-file-name))
|
||||||
|
my/wiki-asset-directory-name))
|
||||||
|
(f-descendant-of-p (buffer-file-name)
|
||||||
|
(expand-file-name +wiki-directory)))
|
||||||
|
(f-mkdir my/wiki-asset-directory-name
|
||||||
|
(f-join my/wiki-asset-directory-name (file-name-sans-extension (buffer-file-name))))
|
||||||
|
(message "Not in the wiki directory.")))
|
||||||
|
|
||||||
(after! tex
|
(after! tex
|
||||||
(TeX-engine-set "luatex")
|
(TeX-engine-set "luatex")
|
||||||
(add-to-list 'safe-local-variable-values
|
(add-to-list 'safe-local-variable-values
|
||||||
@ -107,34 +111,13 @@
|
|||||||
|
|
||||||
;; Custom keybindings
|
;; Custom keybindings
|
||||||
(map!
|
(map!
|
||||||
(:when (featurep! :editor format)
|
(:when (featurep! :tools wiki)
|
||||||
:n "g=" #'+format/buffer)
|
|
||||||
|
|
||||||
(:when (featurep! :lang org +roam)
|
|
||||||
(:map org-roam-mode-map
|
|
||||||
:leader
|
:leader
|
||||||
:prefix "nr"
|
:prefix "nr"
|
||||||
:desc "Find a random Org-roam note" "R" #'org-roam-random-note)))
|
:desc "Create the asset folder" "m" #'my/create-assets-folder)
|
||||||
|
|
||||||
(setq
|
(:when (featurep! :editor format)
|
||||||
;; Modify the time-stamp with each save.
|
:n "g=" #'+format/buffer))
|
||||||
time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S %:z"
|
|
||||||
org-id-link-to-org-use-id t
|
|
||||||
|
|
||||||
;; Set file templates folder at $DOOMDIR/templates.
|
|
||||||
+file-templates-dir (expand-file-name "templates/" doom-private-dir)
|
|
||||||
|
|
||||||
;; Set the journal.
|
|
||||||
org-journal-dir "~/writings/journal"
|
|
||||||
org-journal-file-format "%F"
|
|
||||||
|
|
||||||
enable-local-variables "query"
|
|
||||||
)
|
|
||||||
|
|
||||||
(defun align-non-space (BEG END)
|
|
||||||
"Align non-space columns in region BEG END."
|
|
||||||
(interactive "r")
|
|
||||||
(align-regexp BEG END "\\(\\s-*\\)\\S-+" 1 1 t))
|
|
||||||
|
|
||||||
;; A workaround for electric-indent plugin.
|
;; A workaround for electric-indent plugin.
|
||||||
;; See https://github.com/hlissner/doom-emacs/issues/3172 for more details.
|
;; See https://github.com/hlissner/doom-emacs/issues/3172 for more details.
|
||||||
|
@ -1,20 +1,25 @@
|
|||||||
;;; tools/wiki/config.el -*- lexical-binding: t; -*-
|
;;; tools/wiki/config.el --- The configuration for foo-dogsquared's wiki as a module.
|
||||||
|
;;; -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
;; My custom configuration for setting up my personal wiki.
|
;; My custom configuration for setting up my personal wiki.
|
||||||
;; Also a good opportunity for training my Elisp-fu.
|
;; Also a good opportunity for training my Elisp-fu.
|
||||||
(require 'f)
|
(require 'f)
|
||||||
|
|
||||||
(defvar +anki-cards-directory nil
|
;;; Code:
|
||||||
"The location of the Anki cards")
|
(defvar +wiki-directory "~/wiki")
|
||||||
|
|
||||||
(defvar +structured-notes-directory nil
|
(defvar +anki-cards-directory-name "cards")
|
||||||
"The path of the structured notes used for the Dendron-like features.
|
(defvar +structured-notes-directory-name "structured")
|
||||||
The structured notes are considered separate to the org-roam notes.
|
|
||||||
Though, both notes are integrated in the mindset that org-roam is an extension of
|
|
||||||
the structured notes needed to create atmoic notes.")
|
|
||||||
|
|
||||||
(defun +anki-editor-reset-note ()
|
(defvar +anki-cards-directory (f-join +wiki-directory +anki-cards-directory-name))
|
||||||
"Reset the Anki note in point by deleting the note ID and the deck."
|
(defvar +structured-notes-directory (f-join +wiki-directory +structured-notes-directory-name))
|
||||||
|
|
||||||
|
(defun +anki-editor-push-all-notes-to-anki ()
|
||||||
|
(interactive)
|
||||||
|
(anki-editor-push-notes nil nil (directory-files-recursively +anki-cards-directory "\\.*org" nil)))
|
||||||
|
|
||||||
|
(defun +anki-editor-reset-note () "Reset the Anki note in point by deleting the note ID and the deck."
|
||||||
(interactive)
|
(interactive)
|
||||||
(org-entry-delete (point) anki-editor-prop-note-id)
|
(org-entry-delete (point) anki-editor-prop-note-id)
|
||||||
(org-entry-delete (point) anki-editor-prop-deck))
|
(org-entry-delete (point) anki-editor-prop-deck))
|
||||||
@ -31,7 +36,9 @@ the structured notes needed to create atmoic notes.")
|
|||||||
org-roam-setup
|
org-roam-setup
|
||||||
org-roam-capture
|
org-roam-capture
|
||||||
org-roam-node-find)
|
org-roam-node-find)
|
||||||
:preface (defvar org-roam-directory nil)
|
:preface
|
||||||
|
(defvar org-roam-directory nil)
|
||||||
|
(defvar +wiki-directory nil)
|
||||||
:init
|
:init
|
||||||
(map! :leader
|
(map! :leader
|
||||||
:after org
|
:after org
|
||||||
@ -54,28 +61,35 @@ the structured notes needed to create atmoic notes.")
|
|||||||
(setq org-roam-completion-everywhere t
|
(setq org-roam-completion-everywhere t
|
||||||
org-roam-directory (file-name-as-directory
|
org-roam-directory (file-name-as-directory
|
||||||
(file-truename
|
(file-truename
|
||||||
(expand-file-name (or org-roam-directory "roam")
|
(expand-file-name +wiki-directory
|
||||||
org-directory)))
|
org-directory)))
|
||||||
org-roam-dailies-directory (f-join org-roam-directory "daily"))
|
org-roam-dailies-directory (f-join +wiki-directory "daily"))
|
||||||
(org-roam-setup))
|
(org-roam-setup))
|
||||||
|
|
||||||
(use-package! anki-editor
|
(use-package! anki-editor
|
||||||
:hook (org-mode . anki-editor-mode)
|
:hook (org-mode . anki-editor-mode)
|
||||||
:config
|
:preface
|
||||||
(setq anki-editor-create-decks 't
|
(defvar +wiki-directory nil)
|
||||||
+anki-cards-directory (f-join org-roam-directory "cards"))
|
:init
|
||||||
(map! :localleader
|
(map! :localleader
|
||||||
:map org-mode-map
|
:map org-mode-map
|
||||||
(:prefix ("C" . "Anki cards")
|
(:prefix ("C" . "Anki cards")
|
||||||
"p" #'anki-editor-push-notes
|
"p" #'anki-editor-push-notes
|
||||||
|
"P" #'+anki-editor-push-all-notes-to-anki
|
||||||
"r" #'anki-editor-retry-failure-notes
|
"r" #'anki-editor-retry-failure-notes
|
||||||
"i" #'anki-editor-insert-note
|
"i" #'anki-editor-insert-note
|
||||||
"I" #'anki-editor-cloze-region
|
"I" #'anki-editor-cloze-region
|
||||||
"e" #'anki-editor-export-subtree-to-html
|
"e" #'anki-editor-export-subtree-to-html
|
||||||
"d" #'+anki-editor-reset-note
|
"d" #'+anki-editor-reset-note
|
||||||
"D" #'+anki-editor-reset-all-notes)))
|
"D" #'+anki-editor-reset-all-notes))
|
||||||
|
:config
|
||||||
|
(setq anki-editor-create-decks 't
|
||||||
|
+anki-cards-directory (f-join +wiki-directory +anki-cards-directory-name)))
|
||||||
|
|
||||||
(use-package! dendroam
|
(use-package! dendroam
|
||||||
:after org-roam
|
:after org-roam
|
||||||
|
:preface (defvar +wiki-directory nil)
|
||||||
:config
|
:config
|
||||||
(setq +structured-notes-directory (f-join org-roam-directory "structured")))
|
(setq +structured-notes-directory (f-join +wiki-directory +structured-notes-directory-name)))
|
||||||
|
|
||||||
|
;;; config.el ends here
|
||||||
|
Loading…
Reference in New Issue
Block a user