um-mode/README.md

67 lines
2 KiB
Markdown

# um-mode
[Um](https://git.bth.moi/bth/um) is an (U)ltralight *zettelkasten* for (M)arkdown composition.
* `um-mode` is the emacs mode for managing `*.um` files.
* `um-minor-mode` is an emacs minor mode meant to enhance `markdown-mode`.
`um` is a *zettelkasten* specification, a CLI for creating compositions, and an emacs toolkit. It uses unique filenames, plaintext tags, the builtin emacs `project` package, and simple commandline conventions.
# install
```elisp
(use-package um-mode
:vc (:url "https://git.bth.moi/bth/um-mode" :rev :newest)
:mode ("\\.um\\'" . um-mode)
:hook (markdown-mode-hook . um-minor-mode)
:custom (um-root-glob ".*/writing/journal")
:bind
("M-s t" . um-tag-grep)
("M-r t" . um-tag-dwim)
:config
(advice-add 'embark-target-file-at-point :around 'um-target-file-at-point-advice)
)
```
## um-mode
This:
```
:mode ("\\.um\\'" . um-mode)
```
Enables `um-mode` for `*.um` files, which are treated as lists of Markdown content files.
## um-minor-mode
This:
```
:hook (markdown-mode-hook . um-minor-mode)
```
Hooks `um-minor-mode` into `markdown-mode` to get `um-minor-mode-map` bindings and font locking for the header fields.
## embark-dwim
This:
```
:config (advice-add 'embark-target-file-at-point :around 'um-target-file-at-point-advice)
```
Sets up `embark-dwim` to find files intelligently, explained below.
# ultralight "database"
What I consider the killer feature of `um` is the ability to jump to files from filenames listed in any "child" project back to the "source" project, defined via `um-root-glob`. This means that child projects can be initially defined as simple lists of `*.um` filenames, which I do to compose larger pieces. A simple filename anywhere can also serve as a "link".
There are a few ways this is accessed:
1. `um-find-file-at-point` is hooked into `find-file` by default via `next-history-element`, which will work as `C-x C-f M-n` out of the box.
2. `um-target-file-at-point-advice` via `emark-dwim` on any filename. Requires `embark` and the `advice-add` shown above.