aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2021-10-07 11:31:04 +0100
committerYann Herklotz <git@yannherklotz.com>2021-10-07 11:31:04 +0100
commit45ada01381cffdbeac3bd9532d2be1f09929cef0 (patch)
tree392f8cf8e93bdaa1f24c2854e1fb2470529366fd
parente4f0e140b8c23a008171f3d47af7ce42fc7973fa (diff)
downloaddotfiles-45ada01381cffdbeac3bd9532d2be1f09929cef0.tar.gz
dotfiles-45ada01381cffdbeac3bd9532d2be1f09929cef0.zip
Add hugo to init and remove org-zettelkasten
-rw-r--r--doom/config.el63
-rw-r--r--doom/init.el4
-rw-r--r--doom/packages.el4
3 files changed, 11 insertions, 60 deletions
diff --git a/doom/config.el b/doom/config.el
index 0eaca7b..ec5b1be 100644
--- a/doom/config.el
+++ b/doom/config.el
@@ -629,64 +629,17 @@
;;(use-package! alectryon
;; :load-path "/Users/yannherklotz/Projects/alectryon/etc/elisp")
-(defun ymhg/incr-id (ident)
- (let* ((ident-list (append nil ident nil))
- (last-ident (last ident-list)))
- (setcar last-ident (+ (car last-ident) 1))
- (concat ident-list)))
-
-(defun ymhg/incr-id-total (ident)
- (if (string-match-p "\\(.*[a-z]\\)\\([0-9]+\\)$" ident)
- (progn
- (string-match "\\(.*[a-z]\\)\\([0-9]+\\)$" ident)
- (let ((pre (match-string 1 ident))
- (post (match-string 2 ident)))
- (concat pre (number-to-string (+ 1 (string-to-number post))))))
- (ymhg/incr-id ident)))
-
-(defun ymhg/branch-id (ident)
- (if (string-match-p ".*[0-9]$" ident)
- (concat ident "a")
- (concat ident "1")))
-
-(defun ymhg/org-zettelkasten-create (incr newheading)
- (let* ((current-id (org-entry-get nil "CUSTOM_ID"))
- (next-id (funcall incr current-id)))
- (funcall newheading)
- (org-set-property "CUSTOM_ID" next-id)))
-
-(defun org-zettelkasten-create-next ()
- (ymhg/org-zettelkasten-create
- 'ymhg/incr-id 'org-insert-heading))
-
-(defun org-zettelkasten-create-branch ()
- (ymhg/org-zettelkasten-create
- 'ymhg/branch-id '(lambda () (org-insert-subheading ""))))
-
-(defun org-zettelkasten-create-dwim ()
- (interactive)
- (let ((current-point (save-excursion
- (org-back-to-heading)
- (point)))
- (next-point (save-excursion
- (org-forward-heading-same-level 1 t)
- (point))))
- (if (= current-point next-point)
- (org-zettelkasten-create-next)
- (org-zettelkasten-create-branch))))
-
-;;(defun org-zettelkasten-search-current-id ()
-;; (interactive)
-;; (let ((current-id (org-entry-get nil "CUSTOM_ID")))
-;; (counsel-rg (concat "#" current-id) "~/Dropbox/zk" "-g *.org" "ID: ")))
-
-(defun org-zettelkasten-search-current-id ()
+(use-package! org-zettelkasten
+ :config
+ (add-hook 'org-mode-hook #'org-zettelkasten-mode)
+
+ (defun org-zettelkasten-search-current-id ()
+ "Use `consult-ripgrep' to search for the current ID in all files."
(interactive)
(let ((current-id (org-entry-get nil "CUSTOM_ID")))
- (consult-ripgrep "~/Dropbox/zk" (concat "[\\[:]." current-id "\\]#"))))
+ (consult-ripgrep org-zettelkasten-directory (concat "[\\[:]." current-id "\\]#"))))
-(define-key org-mode-map (kbd "C-c y n") #'org-zettelkasten-create-dwim)
-(define-key org-mode-map (kbd "C-c y z") #'org-zettelkasten-search-current-id)
+ (define-key org-zettelkasten-mode-map (kbd "s") #'org-zettelkasten-search-current-id))
(use-package! ox-hugo
:after ox)
diff --git a/doom/init.el b/doom/init.el
index 5348f13..191daf4 100644
--- a/doom/init.el
+++ b/doom/init.el
@@ -137,11 +137,11 @@
ocaml ; an objective camel
(org ; organize your plain life in plain text
;;+dragndrop ; drag & drop files/images into org buffers
- ;;+hugo ; use Emacs for hugo blogging
+ +hugo ; use Emacs for hugo blogging
;;+jupyter ; ipython/jupyter support for babel
;;+pandoc ; export-with-pandoc support
;;+pomodoro ; be fruitful with the tomato technique
- ;;+present ; using org-mode for presentations
+ +present ; using org-mode for presentations
)
;;perl ; write code no one else can comprehend
;;php ; perl's insecure younger brother
diff --git a/doom/packages.el b/doom/packages.el
index ef8bff7..043f41e 100644
--- a/doom/packages.el
+++ b/doom/packages.el
@@ -8,7 +8,6 @@
(package! ox-reveal)
;(package! ox-ssh)
(package! ox-tufte)
-(package! ox-hugo)
(package! org-transclusion
:recipe (:host github :repo "nobiot/org-transclusion"))
@@ -40,8 +39,7 @@
;; Misc dependencies
(package! hungry-delete)
(package! vagrant-tramp)
-(package! zettelkasten
- :recipe (:host github :repo "ymherklotz/emacs-zettelkasten"))
+(package! org-zettelkasten)
(package! pinentry)
(package! package-lint)