zim-wiki-mode
An elisp package for editing zim-wiki in emacs.
This package primarily provides convenient page linking and journaling by extending dokuwiki-mode
and wrapping functions around helm-projectile
, helm-ag
, and link-hint
. A menu is provided through pretty-hydra
. A very basic and slow completion method (zim-wiki-mode-complete
) uses company-mode
.
Motivation
Zim's plain text markup is open to any editor. But only Zim Desktop Wiki itself is any good at actually editing pages. zim-wiki-mode
intends to improve the editing expereence in Emacs.
use-package
zim-wiki-mode is a recipe in melpa!
If you want bleading edge, grab from the dev
branch.
curl "https://raw.githubusercontent.com/WillForan/zim-wiki-mode/dev/zim-wiki-mode.el" > ~/path/to/zim-wiki-mode.el
~/.emacs
might look like
;; setup wiki mode
(use-package zim-wiki-mode
:load-path "~/path/to/zim-wiki-mode.el" ; if using dev branch, otherwise no need
:bind ("C-c C-n" . zim-wiki-goto-now)
:init
(add-hook 'zim-wiki-mode-hook 'flyspell-mode)
:config
(setq zim-wiki-always-root "~/notes/PersonalWiki") ; if not set, would use projectile directory
(setq zim-wiki-journal-datestr "Calendar/%Y/%02m.txt")
(evil-leader/set-key-for-mode 'zim-wiki-mode "z" 'zim-wiki-hydra/body)
)
Setup
- You should already have a notebook established with zim-wiki, referenced using
(setq zim-wiki-always-root ...
above - This mode was developed with both the journal and version control plugins enabled.
- VC (
.git
directory) is necessary forprojectile
related commands.
- VC (
- If not a la
use-package
above, interactively set the location to your already existing zim notebookM-x customize-group RET zim-wiki RET
Keys
Default keys. Rearranged and annotated output of C-c ?
; menu
C-c C-z zim-wiki-hydra/body see all the options
; go places
C-c C-n zim-wiki-goto-now jump to now page
C-c M-f zim-wiki-helm-projectile go to page by title search
C-c C-f zim-wiki-search go to page by content search
C-c RET zim-wiki-ffap go to link cursor is over
C-c M-RET zim-wiki-ffap-below open link in new window below current
; insert links
C-c M-l zim-wiki-insert-helm-projectile insert link by title searching
C-c C-l zim-wiki-insert-search insert link by filename/title search
C-c C-N zim-wiki-insert-now-link link now page on current page
C-c M-w zim-wiki-link-wrap wrap e.g a:b:c into [[a:b:c]]
; link based on history
C-c C-p zim-wiki-insert-prev-buffer-link insert link on current page to previous buffer
C-c M-y zim-wiki-buffer-path-to-kill-ring copy current buffer file name
C-c M-p zim-wiki-insert-kill-ring-as-link paste filename as link
; date operations
C-c C-n zim-wiki-goto-now jump to now page
C-c C-N zim-wiki-insert-now-link link now page on current page
C-c M-n zim-wiki-insert-current-at-now put current page link on now page, go to now page
Demo
using zim-wiki-mode with evil-mode and leuven theme
- C-c C-n go to the "now" page
- now page date format defined by
zim-wiki-journal-datestr
- now page date format defined by
- C-c l create a new page in hierarchy by searching current tree
- via
helm-projectile
- via
- C-c RET follow the link we just created
- C-c N insert a link to the current date
- write up some text about what we did
- C-c C-l link in that page that has "emacs cider" content but whos name is not memberible
- helm provides C-z to preview
- C-c f go to title: we want to add things to that just linked in page.
- could C-c RET on the link we created, but lets go there with by search file names (page titles)
- or go by search text again (C-c C-f)
- C-c C-p link prev page: while we are there lets add where we came from
- C-c C-n then link the page we are currently editing to the now page
- C-c w paths freehand and wrap them in a link
N.B.
- when following a link, we need to be on the word (not the
[[
or]]
part) - no autosave
- wiki must be under version control for
helm-projectile
(C-c f and C-c l)