Giter VIP home page Giter VIP logo

zk-luhmann's Introduction

Introduction

This package extends ‘zk’ and ‘zk-index’ to include support for working with files assigned Luhmann-style IDs.

A demo of this package can be viewed here: https://youtu.be/O6iSV4pQQ5g

Luhmann-style IDs are alphanumeric sequences that immediately follow the zk-id in a note’s filename. By default, the Luhmann ID is surrounded by parentheses, with each character in the ID delimited by a comma. A note with such a Luhmann ID will have a file name that looks something like:

“202012101215 (1,1,a,3,c) The origin of species.md”

Because all files with Luhmann IDs have normal zk-ids, they are normal zk-files. As a result, the naming and ID scheme supported by this package simply offers a different organizing scheme within a zk. It is both fully integrated with zk while being, nevertheless, completely distinct — a system within a system.

Setup

After setting up ‘zk’ and ‘zk-index’, load zk-luhmann and set the variables as desired:

(add-to-list 'load-path "/path/to/zk-luhmann.el")
(require 'zk-luhmann)

(setq zk-luhmann-id-prefix "{"
      zk-luhmann-id-postfix "}"
      zk-luhmann-id-delimiter ",")

(setq zk-luhmann-indent-index t)

Note that if you change the above variables, you should ensure that the zk-luhmann-id-regexp is set properly by subsequently (re)evaluating the following:

(setq zk-luhmann-id-regexp (concat zk-luhmann-id-prefix
                                   "\\([0-9a-zA-Z"
                                   zk-luhmann-id-delimiter
                                   "]*\\)"
                                   zk-luhmann-id-postfix)

Finally, add zk-luhmann functions to zk-index-map, by include the following to your config file, substituting whatever keybindings you like:

(define-key zk-index-map (kbd "L") #'zk-luhmann-index-sort)
(define-key zk-index-map (kbd "l") #'zk-luhmann-index)
(define-key zk-index-map (kbd "C-f") #'zk-luhmann-index-forward)
(define-key zk-index-map (kbd "C-b") #'zk-luhmann-index-back)
(define-key zk-index-map (kbd "C-t") #'zk-luhmann-index-unfold)
(define-key zk-index-map (kbd "t") #'zk-luhmann-index-top)

Or, with use-package:

(use-package zk-luhmann
  :bind (:map zk-index-map
              ("L" . zk-luhmann-index-sort)
              ("l" . zk-luhmann-index)
              ("C-f" . zk-luhmann-index-forward)
              ("C-b" . zk-luhmann-index-back)
              ("C-t" . zk-luhmann-index-unfold)
              ("t" . zk-luhmann-index-top))
  :custom
  (zk-luhmann-id-prefix "{")
  (zk-luhmann-id-postfix "}")
  (zk-luhmann-indent-index t))

Completion-at-point

To add completion at point for files with Luhmann-style IDs, evaluate the following:

(add-hook 'completion-at-point-functions
          #'zk-luhmann-completion-at-point 'append)

zk-luhmann's People

Contributors

jgru avatar localauthor avatar

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.