summary refs log tree commit diff
path: root/emacs.d
diff options
context:
space:
mode:
Diffstat (limited to 'emacs.d')
-rw-r--r--emacs.d/init.el4
-rw-r--r--emacs.d/lib/my-functions.el11
2 files changed, 15 insertions, 0 deletions
diff --git a/emacs.d/init.el b/emacs.d/init.el
index a154a7e..7661aa0 100644
--- a/emacs.d/init.el
+++ b/emacs.d/init.el
@@ -24,6 +24,10 @@
 
 (use-package my-settings)
 
+(use-package my-functions
+  :config
+  (setq fc/wiki-dir-location "~/src/notes/docs/"))
+
 ;; other packages
 (use-package ag)
 
diff --git a/emacs.d/lib/my-functions.el b/emacs.d/lib/my-functions.el
index e661a01..0bdc6d7 100644
--- a/emacs.d/lib/my-functions.el
+++ b/emacs.d/lib/my-functions.el
@@ -33,6 +33,17 @@
                (set-buffer-modified-p nil)
                (message "File '%s' successfully renamed to '%s'" name (file-name-nondirectory new-name))))))))
 
+;; find a wiki page
+(defun fc/find-wiki-page ()
+  "Finds wiki page."
+    (interactive)
+    (let ((collection
+           (delete-dups
+            (append (directory-files fc/wiki-dir-location)))))
+      (ivy-read "wiki pages:" collection
+                :action (lambda (x) (find-file (concat fc/wiki-dir-location x)))
+                :caller 'fc/find-wiki-page)))
 
+(global-set-key (kbd "C-c w") 'fc/find-wiki-page)
 
 (provide 'my-functions)