Update custom Emacs configuration

This commit is contained in:
Gabriel Arazas 2023-08-24 10:29:32 +08:00
parent e89515dc98
commit b493aa91e8

View File

@ -1,7 +1,9 @@
(defvar +wiki-directory "~/writings/wiki") (defvar +wiki-directory "~/writings/wiki")
(defvar +wiki-notebook-name "notebook") (defvar +wiki-notebook-name "notebook")
(defvar +wiki-notebook-directory (f-join +wiki-directory +wiki-notebook-name)) (defvar +wiki-notebook-directory (f-join +wiki-directory +wiki-notebook-name))
(defvar my/wiki-asset-directory-name "assets") (defvar my/wiki-asset-directory-name "assets")
(defvar my/wiki-exercises-directory "challenges")
(defun my/is-in-wiki-directory (&optional filename) (defun my/is-in-wiki-directory (&optional filename)
"Return t if the file buffer is in the wiki directory." "Return t if the file buffer is in the wiki directory."
@ -13,6 +15,18 @@
t t
nil)) 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) (defun my/get-assets-folder (&optional filename)
"Get the assets folder of the current Org mode document." "Get the assets folder of the current Org mode document."
(unless filename (setq filename (buffer-file-name))) (unless filename (setq filename (buffer-file-name)))