Coder Social home page Coder Social logo

zim-wiki-mode's Introduction

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-to-initialize completion method (zim-wiki-mode-complete) uses company-mode. Zim Desktop Wiki's sqlite db can be accessed for tag completion (company-capf) and backlink lookup (heml).

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 experience in Emacs.

zim-wiki-mode also make editing on Android a bit more accessible, however it's a kludge. See syncthing (or owncloud, gdrive, dropbox, etc), termux, and pkg install emacs

Demo

using zim-wiki-mode with the zerodark theme and M+ 1M font.

demo gif

  • link insert with C-c M-l
  • link auto-complete after (zim-wiki-refresh-completions)
  • link insert from search with helm-ag C-c C-l
  • insert new header after (require 'outline-magic) M-RET and M-S-left/right
  • autocomplete tags. req (zim-wiki-list-tags-refresh), stored in zim-wiki-all-tags
  • insert link to today C-c C-n
  • follow link hint C-c l
  • hydra back links C-c C-z <

use-package

zim-wiki-mode is a recipe in melpa!

If you want bleeding edge, grab from git. ~/.emacs.d/init.el might include

;; setup wiki mode
(use-package zim-wiki-mode
  :quelpa ((dokuwiki :fetcher github :repo "WillForan/zim-wiki-mode") :upgrade t)
  :bind
    ("C-c z" . zim-wiki-goto-now)
    (:map zim-wiki-mode-map
            ("M-p" . #'outline-previous-visible-heading)
            ("M-n" . #'outline-next-visible-heading)
            ("M-S-<return>" . #'org-insert-item))
  :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")

    (zim-wiki-refresh-completion) ; SLOW. get list for company-cap
    (zim-wiki-list-tags-refresh)  ; get tags from sqlite3 db

    (evil-leader/set-key-for-mode 'zim-wiki-mode "z" 'zim-wiki-hydra/body))


;; modified dokuwiki-mode with outline-magic symmetric headers
(use-package dokuwiki-mode
  :quelpa ((dokuwiki :fetcher github :repo "WillForan/dokuwiki-mode") :upgrade t)
  :ensure t
  :config
   (require outline-magic)
   (flyspell-mode 1))

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 for projectile related commands.
  • If not a la use-package above, interactively set the location to your already existing zim notebook M-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

zim-wiki-mode's People

Contributors

shivams avatar willforan avatar willforan2009 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

zim-wiki-mode's Issues

render/insert tags and headings

i just discovered this package, and would love to be able to edit my zim files in emacs. i can't see any capacity to handle headings or tags though, is that correct? they're both pretty basic and necessary, at least for the way i use zim.

(i see i can just manually insert headings, and they render, but tags not at all.)

remove unnecessary dependencies

would you please remove unnecessary dependencies such as helm-ag, helm-projectile, link-hint, and pretty-hydra?

i don't use helm and don't want to load it unnecessarily, ditto with some other users regarding avy and hydra.

you can easily make such deps and the features that use them optional. e.g. there are many ways to search stuff other than helm-ag, and you can do things like what you do in zim-wiki-backlink-helm by using generic completion facilities that will work with any user's completion config.

follow links to files

i think this is supposed to be implemented, but it doesn't work for me with multiple word links, as ffap-string-at-point (in zim-wiki-ffap-file) will just collect word at point if there are many words. almost all of my zim wiki links have multiple words.

a better implementation would fetch the whole link, probably using next/prev-property change for docuwiki-link, then strip the [[ ]].

if i mark the link text, then the command works.

or is there a way to do this and i just can't see it for now?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.