aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2021-10-02 12:32:21 +0100
committerYann Herklotz <git@yannherklotz.com>2021-10-02 12:32:21 +0100
commit23d5ff38cb99416ce87de3fe2151f3a0b1935160 (patch)
treeba21b2dc508e2672c833fd3e7101c4c9f6bc4d32
parent2d83c14c9634271428572435804adad0d3de31d5 (diff)
downloademacs-zettelkasten-23d5ff38cb99416ce87de3fe2151f3a0b1935160.tar.gz
emacs-zettelkasten-23d5ff38cb99416ce87de3fe2151f3a0b1935160.zip
Remove counsel dependency from org-zettelkasten
-rw-r--r--CHANGELOG17
-rw-r--r--README.md70
-rw-r--r--org-zettelkasten.el10
3 files changed, 74 insertions, 23 deletions
diff --git a/CHANGELOG b/CHANGELOG
index d158c2c..34e24da 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,12 +1,23 @@
+2021-10-02 Yann Herklotz <git@ymhg.org>
+
+ * v0.3.0: Remove counsel as a dependency and add completion to
+ README.
+
2021-01-22 Yann Herklotz <git@ymhg.org>
- * v0.2.0: Add org-zettelkasten, a different mode which adds helper functions to org-mode to use it as a Zettelkasten.
+ * v0.2.0: Add org-zettelkasten, a different mode which adds helper
+ functions to org-mode to use it as a Zettelkasten.
2020-12-08 Yann Herklotz <git@ymhg.org>
* v0.1.1: Release the first stable version of Zettelkasten.
- Implemented simple Zettelkasten method, which just contains chronological notes and links to relate them.
+
+ Implemented simple Zettelkasten method, which just contains
+ chronological notes and links to relate them.
+
(website): Better generation of website from the Zettelkasten.
* v0.1.0: First release.
- Implement simple Zettelkasten method which also allows for a simple generation of a website.
+
+ Implement simple Zettelkasten method which also allows for a
+ simple generation of a website.
diff --git a/README.md b/README.md
index 59f581a..2835e92 100644
--- a/README.md
+++ b/README.md
@@ -5,21 +5,63 @@
| `zettelkasten` | [![MELPA](https://melpa.org/packages/zettelkasten-badge.svg)](https://melpa.org/#/zettelkasten) |
| `org-zettelkasten` | [![MELPA](https://melpa.org/packages/org-zettelkasten-badge.svg)](https://melpa.org/#/org-zettelkasten) |
-[Zettelkasten](https://zettelkasten.de/) is a note-taking technique designed to keep, and create new links between all the notes as they are written. This allows them to develop over time, link to various different topics and allow the notes to grow into a network over time. This helps draw connections between different fields.
+[Zettelkasten](https://zettelkasten.de/) is a note-taking technique designed to keep, and create new
+links between all the notes as they are written. This allows them to develop over time, link to
+various different topics and allow the notes to grow into a network over time. This helps draw
+connections between different fields.
-This emacs mode is meant to allow for a very simple wrapper over linked text files. By default, `org` files are used, which are linked through simple file links. The name of the file that is created is just a unique ID.
+This emacs mode is meant to allow for a very simple wrapper over linked text files. By default,
+`org` files are used, which are linked through simple file links. The name of the file that is
+created is just a unique ID.
Each file can then link to other files and they can easily be browsed through in emacs.
-This mode is completely standalone, it does not require any other tools so is easy to install, use and edit appropriately.
+This mode is completely standalone, it does not require any other tools so is easy to install, use
+and edit appropriately.
## `org-zettelkasten` and `zettelkasten`
-This repository contains two packages which are also on Melpa, and are separate from each other, giving two different ways to use the Zettelkasten method in Emacs. One (`org-zettelkasten`) leverages emacs' [`org-mode`](https://orgmode.org/), and the other (`zettelkasten`) is an implementation from scratch, which can either use `org-mode` files or markdown files as a base.
+This repository contains two packages which are also on Melpa, and are separate from each other,
+giving two different ways to use the Zettelkasten method in Emacs. One (`org-zettelkasten`)
+leverages emacs' [`org-mode`](https://orgmode.org/), and the other (`zettelkasten`) is an
+implementation from scratch, which can either use `org-mode` files or markdown files as a base.
+
+### Tag search
+
+Tag search can be implemented using your favourite completion framework. These will use the `ID` at
+the current heading and will look for any other notes that reference this heading (i.e. it will find
+all the back links of the current heading).
+
+#### Tag search with counsel
+
+``` emacs-lisp
+(defun org-zettelkasten-search-current-id ()
+ "Use `counsel-rg' to search for the current ID in all files."
+ (interactive)
+ (let ((current-id (org-entry-get nil "CUSTOM_ID")))
+ (counsel-rg (concat "#" current-id) org-zettelkasten-directory "-g *.org" "ID: ")))
+```
+
+#### Tag search with consult
+
+``` emacs-lisp
+(defun org-zettelkasten-search-current-id ()
+ (interactive)
+ (let ((current-id (org-entry-get nil "CUSTOM_ID")))
+ (consult-ripgrep org-zettelkasten-directory (concat "[\\[:]." current-id "\\]#"))))
+```
+
+#### Add search to keymap
+
+``` emacs-lisp
+(define-key org-zettelkasten-mode-map (kbd "s") #'org-zettelkasten-search-current-id)
+```
## How to use `org-zettelkasten`
-The method implemented in `org-zettelkasten` has been described in detail in a [blog article](https://yannherklotz.com/blog/2020-12-21-introduction-to-luhmanns-zettelkasten.html). It leverages `org-mode` features such as `CUSTOM_ID`,
+The method implemented in `org-zettelkasten` has been described in detail in a [blog
+article](https://yannherklotz.com/blog/2020-12-21-introduction-to-luhmanns-zettelkasten.html). It
+leverages `org-mode` features such as `CUSTOM_ID`,
**Manual Installation**
@@ -40,7 +82,8 @@ The method implemented in `org-zettelkasten` has been described in detail in a [
## How to use `zettelkasten`
-To use Zettelkasten, first create a directory which will contain all your notes. This will be a flat directory, as tags are used to place notes into specific categories.
+To use Zettelkasten, first create a directory which will contain all your notes. This will be a flat
+directory, as tags are used to place notes into specific categories.
``` shell
mkdir ~/zettelkasten
@@ -91,11 +134,13 @@ To open a parent note of the current note, the following command can be used:
M-x zettelkasten-find-parent
```
-This opens the chosen parent note from a list of available notes. This is bound to `C-c k p` by default.
+This opens the chosen parent note from a list of available notes. This is bound to `C-c k p` by
+default.
### Default bindings
-The default keymap for the mode is `C-c k`, this can easily be changed though by editing `zettelkasten-prefix`.
+The default keymap for the mode is `C-c k`, this can easily be changed though by editing
+`zettelkasten-prefix`.
| Function | Key | Description |
|---|---|---|
@@ -107,8 +152,11 @@ The default keymap for the mode is `C-c k`, this can easily be changed though by
## Alternatives
-An alternative to use Zettelkasten in emacs is [Zetteldeft](https://github.com/EFLS/zetteldeft), which uses Deft as a backend to search files.
+An alternative to use Zettelkasten in emacs is [Zetteldeft](https://github.com/EFLS/zetteldeft),
+which uses Deft as a backend to search files.
-Another beefier alternative is [org-roam](https://github.com/jethrokuan/org-roam/), which is a fully integrated note taking system based on a wiki-system.
+Another beefier alternative is [org-roam](https://github.com/jethrokuan/org-roam/), which is a fully
+integrated note taking system based on a wiki-system.
-Finally, [org-brain](https://github.com/Kungsgeten/org-brain) is a similar note-taking system that is meant for concept mapping in Emacs.
+Finally, [org-brain](https://github.com/Kungsgeten/org-brain) is a similar note-taking system that
+is meant for concept mapping in Emacs.
diff --git a/org-zettelkasten.el b/org-zettelkasten.el
index 18d446f..6642c30 100644
--- a/org-zettelkasten.el
+++ b/org-zettelkasten.el
@@ -3,7 +3,7 @@
;; Author: Yann Herklotz <yann@ymhg.org>
;; URL: https://github.com/ymherklotz/emacs-zettelkasten
;; Version: 0.3.0
-;; Package-Requires: ((emacs "24.3") (org "9.0") (counsel "0.12.0"))
+;; Package-Requires: ((emacs "24.3") (org "9.0"))
;; Keywords: files, hypermedia, Org, notes
;;; Commentary:
@@ -33,7 +33,6 @@
;;; Code:
(require 'org)
-(require 'counsel)
(defgroup org-zettelkasten nil
"Helper to work with zettelkasten notes."
@@ -113,16 +112,9 @@ NEWHEADING: function used to create the heading and set the current
(org-zettelkasten-create-next)
(org-zettelkasten-create-branch))))
-(defun org-zettelkasten-search-current-id ()
- "Use `counsel-rg' to search for the current ID in all files."
- (interactive)
- (let ((current-id (org-entry-get nil "CUSTOM_ID")))
- (counsel-rg (concat "#" current-id) org-zettelkasten-directory "-g *.org" "ID: ")))
-
(defvar org-zettelkasten-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "n" #'org-zettelkasten-create-dwim)
- (define-key map "s" #'org-zettelkasten-search-current-id)
map))
(defvar org-zettelkasten-minor-mode-map