From b493aa91e8c53573c898e7a8afd34642f1d1d78a Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 24 Aug 2023 10:29:32 +0800 Subject: [PATCH] Update custom Emacs configuration --- config.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config.el b/config.el index b1bc885..26b0cca 100644 --- a/config.el +++ b/config.el @@ -1,7 +1,9 @@ (defvar +wiki-directory "~/writings/wiki") (defvar +wiki-notebook-name "notebook") (defvar +wiki-notebook-directory (f-join +wiki-directory +wiki-notebook-name)) + (defvar my/wiki-asset-directory-name "assets") +(defvar my/wiki-exercises-directory "challenges") (defun my/is-in-wiki-directory (&optional filename) "Return t if the file buffer is in the wiki directory." @@ -13,6 +15,18 @@ t nil)) +;; Automate updating timestamps on save. +(add-hook! 'before-save-hook 'time-stamp) + +;; Custom keybindings +(map! + (:when (modulep! :tools wiki) + :leader + :prefix "nr" :desc "Create the asset folder" "m" #'my/create-assets-folder) + + (:when (modulep! :editor format) + :n "g=" #'+format/buffer)) + (defun my/get-assets-folder (&optional filename) "Get the assets folder of the current Org mode document." (unless filename (setq filename (buffer-file-name)))