From cef49752fd0ec9935544d23be878bf3c19c50d89 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 5 May 2016 01:20:32 +0000 Subject: [PATCH] dev docs: Create HACKING.md. Review-by: Matthew Martin --- HACKING.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 HACKING.md diff --git a/HACKING.md b/HACKING.md new file mode 100644 index 0000000..5ce72d8 --- /dev/null +++ b/HACKING.md @@ -0,0 +1,32 @@ +Hacking on zsh-syntax-highlighting itself +========================================= + +This document includes information for people working on z-sy-h itself: on the +core driver (`zsh-syntax-highlighting.zsh`), on the highlighters in the +distribution, and on the test suite. It does not target third-party +highlighter authors (although they may find it an interesting read). + +The 'main' highlighter +---------------------- + +The following function `pz` is useful when working on the `main` highlighting: + + pq() { + (( $#argv )) || return 0 + print -r -l -- ${(qqqq)argv} + } + pz() { + local arg + for arg; do + pq ${(z)arg} + done + } + +It prints, for each argument, its token breakdown, similar to how the main +loop of the `main` highlighter sees it. + +IRC channel +----------- + +We're on #zsh-syntax-highlighting on freenode. +