<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ❮ ZI ❯</title>
    <description>The latest articles on DEV Community by ❮ ZI ❯ (@zsh).</description>
    <link>https://dev.to/zsh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F793538%2F36d5d679-e24f-49ec-9c05-dee6705b759a.png</url>
      <title>DEV Community: ❮ ZI ❯</title>
      <link>https://dev.to/zsh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zsh"/>
    <language>en</language>
    <item>
      <title>✨〰️A Swiss Army Knife for Zsh〰️Unix Shell〰️✨</title>
      <dc:creator>❮ ZI ❯</dc:creator>
      <pubDate>Tue, 31 May 2022 07:54:58 +0000</pubDate>
      <link>https://dev.to/zsh/a-swiss-army-knife-for-zshunix-shell-id5</link>
      <guid>https://dev.to/zsh/a-swiss-army-knife-for-zshunix-shell-id5</guid>
      <description>&lt;p&gt;&lt;a href="https://community.ops.io/images/PxOXrZebj5AbDai_gYqO10eqFupGiKD-zKHMbp4jE4c/w:880/mb:500000/ar:1/aHR0cHM6Ly9jZG4t/aW1hZ2VzLTEubWVk/aXVtLmNvbS9tYXgv/MzIwLzAqRjFzU0tX/eWE4YXhmM0tJWS5w/bmc"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZmLaF2mQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://community.ops.io/images/PxOXrZebj5AbDai_gYqO10eqFupGiKD-zKHMbp4jE4c/w:880/mb:500000/ar:1/aHR0cHM6Ly9jZG4t/aW1hZ2VzLTEubWVk/aXVtLmNvbS9tYXgv/MzIwLzAqRjFzU0tX/eWE4YXhmM0tJWS5w/bmc" alt="ZI Swiss army knife" width="320" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://github.com/z-shell/zi"&gt;❮ ZI ❯&lt;/a&gt; 🧙‍‍♀️ A Swiss Army Knife for Zsh.
&lt;/h3&gt;

&lt;p&gt;Designed to glue everything together. 🔗&lt;/p&gt;

&lt;p&gt;&lt;a href="https://z.digitalclouds.dev"&gt;https://z.digitalclouds.dev&lt;/a&gt; | &lt;a href="https://github.com/z-shell/"&gt;GitHub&lt;/a&gt; | &lt;a href="https://github.com/orgs/z-shell/discussions/"&gt;Discussions&lt;/a&gt; | &lt;a href="https://crowdin.digitalclouds.dev"&gt;Localize&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚡️ Fast and feature-rich
&lt;/h2&gt;

&lt;p&gt;✴️ &lt;a href="https://z.digitalclouds.dev/search?q=meta+plugins"&gt;🌀Meta-plugins&lt;/a&gt; installs a group of complex plugins via a simple label, curated and optimal settings which are automatically applied.&lt;/p&gt;

&lt;p&gt;✴️ &lt;a href="https://z.digitalclouds.dev/ecosystem/packages"&gt;🌀Packages&lt;/a&gt; offloads from complex configurations and stores them as an easy to swap &amp;amp; share profiles.&lt;/p&gt;

&lt;p&gt;✴️ &lt;a href="https://z.digitalclouds.dev/ecosystem/annexes"&gt;🌀Annexes&lt;/a&gt; are extensions that are installed when required to provide additional functionality, and capabilities.&lt;/p&gt;

&lt;p&gt;✴️ &lt;a href="https://z.digitalclouds.dev/docs/getting_started/overview#turbo-mode-zsh--53"&gt;🌀Turbo&lt;/a&gt; mode yields &lt;strong&gt;50–80%&lt;/strong&gt; faster Zsh startup, just because no one likes to wait for someone :)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;🥵 Currently biggest issue is that it seems to be too complex for new users and recently made some adjustments which are now starting to provide the results.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  ☑️ Neat and flexible
&lt;/h2&gt;

&lt;p&gt;✴️ &lt;a href="https://z.digitalclouds.dev/docs/guides/customization#customizing-paths"&gt;Customize&lt;/a&gt; the paths, use &lt;a href="https://z.digitalclouds.dev/docs/guides/customization#multiple-prompts"&gt;multiple prompts&lt;/a&gt; in the same sessions by setting the triggers or create &lt;a href="https://z.digitalclouds.dev/docs/guides/customization#non-github-local-plugins"&gt;your own&lt;/a&gt; plugins to simplify or improve the routine.&lt;/p&gt;

&lt;p&gt;✴️ Supports &lt;a href="https://z.digitalclouds.dev/docs/getting_started/overview#oh-my-zsh-prezto"&gt;Oh My Zsh&lt;/a&gt; and &lt;a href="https://z.digitalclouds.dev/docs/getting_started/overview#oh-my-zsh-prezto"&gt;Prezto&lt;/a&gt; plugins and libraries. ( &lt;a href="https://z.digitalclouds.dev/docs/getting_started/migration"&gt;migration&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;✴️ Does not use &lt;strong&gt;$FPATH&lt;/strong&gt; , loading multiple plugins doesn't clutter &lt;strong&gt;$FPATH&lt;/strong&gt; with the same number of entries, e.g: 10, 15, even, or more.&lt;/p&gt;

&lt;p&gt;✴️ Code is immune to &lt;strong&gt;KSH_ARRAYS&lt;/strong&gt; and other options, which typically cause compatibility problems.&lt;/p&gt;

&lt;p&gt;✴️ Do not require &lt;strong&gt;sudo&lt;/strong&gt; , and provide many ways &amp;amp; workarounds to set up a clean and safe environment. e.g: setting so-called &lt;strong&gt;shims&lt;/strong&gt; locally.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If there is something that is not supported yet, I am pretty confident that if there will be reasonable demand - it will be implemented. 🔨&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  📈 Familiarize and control
&lt;/h2&gt;

&lt;p&gt;✴️ Quickly familiarize oneself with a new plugin and provides rich and easy-to-digest information that might be helpful on various occasions.&lt;/p&gt;

&lt;p&gt;✴️ &lt;a href="https://z.digitalclouds.dev/docs/guides/commands#loading-and-unloading"&gt;Load, unload&lt;/a&gt; plugins when required, use the ability to &lt;a href="https://z.digitalclouds.dev/docs/guides/commands#completions-management"&gt;manage&lt;/a&gt; completions.&lt;/p&gt;

&lt;p&gt;✴️ Docker &lt;a href="https://github.com/z-shell/playground"&gt;playground&lt;/a&gt; to test, view, or propose configurations.&lt;/p&gt;

&lt;p&gt;✴️ &lt;a href="https://z.digitalclouds.dev/docs/gallery/collection"&gt;💫Gallery&lt;/a&gt; of the user favorites.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Is only limited to your own 🤦‍♂️ imagination… 🧙‍‍♀️ We need the support to make it better and more approachable to new users, become a 💞 friend of the DEV 💞, and more ☁️ cloud-native ☁️.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>zi</category>
      <category>shell</category>
      <category>zsh</category>
      <category>devops</category>
    </item>
    <item>
      <title>❮ ZI ❯ Vim Syntax</title>
      <dc:creator>❮ ZI ❯</dc:creator>
      <pubDate>Thu, 28 Apr 2022 08:52:00 +0000</pubDate>
      <link>https://dev.to/z-shell/zi-vim-syntax-d7o</link>
      <guid>https://dev.to/z-shell/zi-vim-syntax-d7o</guid>
      <description>&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tr&gt;&lt;td&gt;
&lt;h3&gt;
&lt;a href="https://github.com/z-shell/zi" rel="noopener noreferrer"&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fz-shell.png"&gt;❮ ZI ❯ Vim Syntax&lt;/a&gt;
&lt;/h3&gt;



&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5y3wharjzc3dgha9q34.png" alt="z-shell zi"&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://wiki.zshell.dev/" rel="noopener noreferrer"&gt;Wiki&lt;/a&gt; | &lt;a href="https://github.com/z-shell/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; | &lt;a href="https://github.com/orgs/z-shell/discussions/" rel="noopener noreferrer"&gt;Discussions&lt;/a&gt; | &lt;a href="https://crowdin.digitalclouds.dev" rel="noopener noreferrer"&gt;Localize&lt;/a&gt;&lt;/p&gt;








&lt;p&gt;A Vim syntax definition for &lt;a href="https://github.com/z-shell/zi" rel="noopener noreferrer"&gt;ZI&lt;/a&gt; commands in any file of type &lt;code&gt;zsh&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;Load as a Vim plugin. E.g. when using &lt;a href="https://github.com/junegunn/vim-plug" rel="noopener noreferrer"&gt;vim-plug&lt;/a&gt;, add to &lt;code&gt;~/.vimrc&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;Plug &lt;span class="s1"&gt;'z-shell/zi-vim-syntax'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and then issue the &lt;code&gt;:PlugInstall&lt;/code&gt; command.&lt;/p&gt;




&lt;h3&gt;
  
  
  Manual Installation
&lt;/h3&gt;

&lt;p&gt;To install the syntax copy the file &lt;code&gt;after/syntax/zsh.vim&lt;/code&gt; under the path &lt;code&gt;~/.vim/syntax/after&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;

&lt;p&gt;The default theme:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fz-shell%2Fzi-vim-syntax%2Fraw%2Fmain%2Fdocs%2Fimages%2Fdefault.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fz-shell%2Fzi-vim-syntax%2Fraw%2Fmain%2Fdocs%2Fimages%2Fdefault.png" alt="plastic"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The theme &lt;code&gt;flrnprz/plastic.vim&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fz-shell%2Fzi-vim-syntax%2Fraw%2Fmain%2Fdocs%2Fimages%2Fplastic.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fz-shell%2Fzi-vim-syntax%2Fraw%2Fmain%2Fdocs%2Fimages%2Fplastic.png" alt="plastic"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The theme &lt;code&gt;slate&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fz-shell%2Fzi-vim-syntax%2Fraw%2Fmain%2Fdocs%2Fimages%2Fslate.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fz-shell%2Fzi-vim-syntax%2Fraw%2Fmain%2Fdocs%2Fimages%2Fslate.png" alt="slate"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The theme &lt;code&gt;murphy&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fz-shell%2Fzi-vim-syntax%2Fraw%2Fmain%2Fdocs%2Fimages%2Fmurphy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fz-shell%2Fzi-vim-syntax%2Fraw%2Fmain%2Fdocs%2Fimages%2Fmurphy.png" alt="plastic"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The theme &lt;code&gt;lucasprag/simpleblack&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fz-shell%2Fzi-vim-syntax%2Fraw%2Fmain%2Fdocs%2Fimages%2Fsimpleblack.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fz-shell%2Fzi-vim-syntax%2Fraw%2Fmain%2Fdocs%2Fimages%2Fsimpleblack.png" alt="plastic"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vim</category>
      <category>zsh</category>
      <category>hacktoberfest</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>🚀 Valgrind automatic test suite</title>
      <dc:creator>❮ ZI ❯</dc:creator>
      <pubDate>Mon, 18 Apr 2022 11:55:00 +0000</pubDate>
      <link>https://dev.to/z-shell/valgrind-automatic-test-suite-ah</link>
      <guid>https://dev.to/z-shell/valgrind-automatic-test-suite-ah</guid>
      <description>&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tr&gt;&lt;td&gt;
&lt;a title="ZI" href="https://github.com/z-shell/zi/"&gt;
&lt;h3&gt;
&lt;a href="https://github.com/z-shell.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9oVhICzG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell.png" width="320" height="320"&gt;&lt;/a&gt;
❮ ZI ❯ - &lt;a href="https://github.com/z-shell/VATS"&gt;VATS&lt;/a&gt;
&lt;/h3&gt;
&lt;h3&gt; Valgrind automatic test suite &lt;/h3&gt;
&lt;/a&gt;&lt;a href="https://asciinema.org/a/488213"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yIl3Jys_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://asciinema.org/a/488213.svg" width="880" height="234"&gt;&lt;/a&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://wiki.zshell.dev/"&gt;Wiki&lt;/a&gt; | &lt;a href="https://github.com/z-shell/"&gt;GitHub&lt;/a&gt; | &lt;a href="https://github.com/orgs/z-shell/discussions/"&gt;Discussions&lt;/a&gt; | &lt;a href="https://crowdin.digitalclouds.dev"&gt;Localize&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Runs sequence of tests, preceded by &lt;code&gt;valgrind&lt;/code&gt; call, with a command and arguments taken from file &lt;code&gt;vtest.conf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The arguments are dynamic because the &lt;code&gt;vtest.conf&lt;/code&gt; entry can look like this:&lt;/p&gt;






&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Arguments passed to $test_bin, evaluated at use (i.e. for each test separately)
test_bin_args='+Z -f $ZTST_srcdir/ztst.zsh $file'   # runs ztst.zsh on given $file
test_bin="local-zsh"                                # expands to ../Src/zsh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;The variable &lt;code&gt;$file&lt;/code&gt; is set to current test-file for each test-run. For Zsh-integrated valgrind tests, &lt;code&gt;$file&lt;/code&gt; is just passed as argument to &lt;code&gt;ztst.zsh&lt;/code&gt;. It comes from the outer loop in &lt;code&gt;vruntests.zsh&lt;/code&gt;. So it is &lt;code&gt;A01grammar.ztst&lt;/code&gt;, for example.&lt;/p&gt;




&lt;h3&gt;
  
  
  Error Definitions
&lt;/h3&gt;




&lt;p&gt;You can define errors so that they are skipped from test result (i.e. from Valgrind output). This is&lt;br&gt;
the main feature of VATS because it allows to quickly check if changes broke anything. Usage is very&lt;br&gt;
much like of unit tests – run &lt;code&gt;make TESTNUM=A01&lt;/code&gt;, look for any red color, done. Zero parsing with&lt;br&gt;
eyes. A typical definition for Zshell can look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;errors1+&lt;span class="o"&gt;=(&lt;/span&gt; &lt;span class="s2"&gt;"* / zsh_main / setupvals / gettimeofday / *"&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and is placed in &lt;code&gt;__error1.def&lt;/code&gt; or other such file with index.&lt;/p&gt;




&lt;h3&gt;
  
  
  Integrating With Project
&lt;/h3&gt;




&lt;p&gt;Following patch applied to the Test/Makefile solves the integration of VATS to Zsh:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="err"&gt;──────────────────────────────────────────────────────────────────────────────────────────&lt;/span&gt;
modified: Test/Makefile.in
&lt;span class="err"&gt;──────────────────────────────────────────────────────────────────────────────────────────&lt;/span&gt;
@@ -35,6 +35,7 @@ VPATH           = @srcdir@
 sdir            = @srcdir@
 sdir_top        = @top_srcdir@
 INSTALL         = @INSTALL@
&lt;span class="gi"&gt;+VLGRND                 = $(VALGRIND:1=v)
&lt;/span&gt; @DEFS_MK@
&lt;span class="p"&gt;@@ -49,7 +50,7 @@&lt;/span&gt; check test:
            do echo $$f; done`" \
         ZTST_srcdir="$(sdir)" \
         ZTST_exe=$(dir_top)/Src/zsh@EXEEXT@ \
&lt;span class="gd"&gt;-        $(dir_top)/Src/zsh@EXEEXT@ +Z -f $(sdir)/runtests.zsh; then \
&lt;/span&gt;&lt;span class="gi"&gt;+        $(dir_top)/Src/zsh@EXEEXT@ +Z -f $(sdir)/$(VLGRND)runtests.zsh; then \
&lt;/span&gt;         stat=0; \
        else \
         stat=1; \
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Basic Test-Configuration
&lt;/h3&gt;




&lt;p&gt;The configuration-file of tests is &lt;code&gt;vtest.conf&lt;/code&gt;. It defines two settings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;test_bin&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"../Src/cgiturl"&lt;/span&gt;   &lt;span class="c"&gt;# Binary that runs any test (is the tested program itself)&lt;/span&gt;
&lt;span class="nv"&gt;zsh_control_bin&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"zsh"&lt;/span&gt;       &lt;span class="c"&gt;# Binary used when scheduling tests &amp;amp; interpreting Valgrind output&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Variable &lt;code&gt;zsh_control_bin&lt;/code&gt; is used to implement special &lt;code&gt;#!&lt;/code&gt; behavior: &lt;code&gt;runtests.zsh&lt;/code&gt;&lt;br&gt;
starts with &lt;code&gt;#!/bin/sh&lt;/code&gt;, reads &lt;code&gt;vtest.conf&lt;/code&gt;, and restarts with &lt;code&gt;$zsh_control_bin&lt;/code&gt;. This way&lt;br&gt;
user can define shebang interpreter via separate configuration file (&lt;code&gt;vtest.conf&lt;/code&gt;).&lt;/p&gt;
&lt;h3&gt;
  
  
  Remaining Test-Configuration
&lt;/h3&gt;

&lt;p&gt;The setting &lt;code&gt;tkind&lt;/code&gt; is used to set a &lt;strong&gt;test-kind&lt;/strong&gt;. These are modes of Valgrind operation.&lt;br&gt;
Allowed values are: &lt;code&gt;error&lt;/code&gt; (only detect read/write errors), &lt;code&gt;leak&lt;/code&gt; (also detect memory leaks),&lt;br&gt;
&lt;code&gt;nopossiblylost&lt;/code&gt; (detect memory leaks, but not &lt;em&gt;possibly&lt;/em&gt; lost blocks).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;test_kind&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"leak"&lt;/span&gt;             &lt;span class="c"&gt;# Test kind: error, (leak|full - the same meaning), nopossiblylost&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Valgrind&lt;/code&gt; messages of type &lt;code&gt;summary&lt;/code&gt; and &lt;code&gt;info&lt;/code&gt; are muted via lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;summaries&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"no"&lt;/span&gt;               &lt;span class="c"&gt;# show valgrind summaries?&lt;/span&gt;
&lt;span class="nv"&gt;info&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"no"&lt;/span&gt;                    &lt;span class="c"&gt;# show info messages?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  The vtest.conf pasted
&lt;/h3&gt;






&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# -*- Mode: sh; indent-tabs-mode: nil; -*-&lt;/span&gt;
&lt;span class="c"&gt;# vim:ft=zsh:sw=4:sts=4:et&lt;/span&gt;
&lt;span class="c"&gt;# Main&lt;/span&gt;
&lt;span class="nv"&gt;test_bin&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"local-zsh"&lt;/span&gt;         &lt;span class="c"&gt;# Binary that runs any test (local-zsh: ../Src/zsh)&lt;/span&gt;
&lt;span class="nv"&gt;zsh_control_bin&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"zsh"&lt;/span&gt;        &lt;span class="c"&gt;# Binary used when scheduling tests &amp;amp; interpreting Valgrind output&lt;/span&gt;
&lt;span class="nv"&gt;main_operation_parsing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"yes"&lt;/span&gt; &lt;span class="c"&gt;# The main feature, whether to use it (i.e. whether to parse valgrind's output)&lt;/span&gt;
&lt;span class="nv"&gt;valgrind_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"valgrind"&lt;/span&gt;     &lt;span class="c"&gt;# Find the valgrind binary to run through $PATH&lt;/span&gt;
&lt;span class="c"&gt;# Valgrind run modes&lt;/span&gt;
&lt;span class="nv"&gt;test_kind&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"leak"&lt;/span&gt;             &lt;span class="c"&gt;# Test kind: error, (leak|full - the same meaning), nopossiblylost&lt;/span&gt;
&lt;span class="nv"&gt;track_origins&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"no"&lt;/span&gt;           &lt;span class="c"&gt;# Whether to pass --track-origns=yes to valgrind binary&lt;/span&gt;
&lt;span class="c"&gt;# Gating of Valgrind's and other output&lt;/span&gt;
&lt;span class="nv"&gt;summaries&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"no"&lt;/span&gt;               &lt;span class="c"&gt;# Show valgrind summaries?&lt;/span&gt;
&lt;span class="nv"&gt;info&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"no"&lt;/span&gt;                    &lt;span class="c"&gt;# Show info messages?&lt;/span&gt;
&lt;span class="nv"&gt;test_desc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"yes"&lt;/span&gt;              &lt;span class="c"&gt;# Whether to print Zsh test-description during operation&lt;/span&gt;
&lt;span class="c"&gt;# DEBUG, especially interested_in="a-function" helps to check why e.g. your&lt;/span&gt;
&lt;span class="c"&gt;# error definition that targets `a-function' doesn't match&lt;/span&gt;
&lt;span class="nv"&gt;mdebug&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"no"&lt;/span&gt;                  &lt;span class="c"&gt;# Match-debug, use to debug error definition matching&lt;/span&gt;
&lt;span class="nv"&gt;interested_in&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;             &lt;span class="c"&gt;# As if mdebug=1 (i.e. debugging of why an error-def matches&lt;/span&gt;
                             &lt;span class="c"&gt;# or not), but only active if: stack trace and error definition&lt;/span&gt;
                             &lt;span class="c"&gt;# contain $interested_in&lt;/span&gt;
&lt;span class="c"&gt;#interested_in="*mk*temp"    # Example value, will match error def:&lt;/span&gt;
                             &lt;span class="c"&gt;# "* / (_|)mk(s|)temp / * / find_temp_path"&lt;/span&gt;
&lt;span class="c"&gt;#interested_in="(*locale*|*fork*|*printf*)" # Other example value - debugging multiple error-defs at once&lt;/span&gt;
&lt;span class="c"&gt;# Arguments passed to $test_bin (i.e. ../Src/zsh most of the time), evaluated&lt;/span&gt;
&lt;span class="c"&gt;# at use (i.e. getting the value of $file will be done at each loop cycle).&lt;/span&gt;
&lt;span class="nv"&gt;test_bin_args&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'+Z -f $ZTST_srcdir/ztst.zsh $file'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>zsh</category>
      <category>testing</category>
      <category>hacktoberfest</category>
      <category>tooling</category>
    </item>
    <item>
      <title>🥷 A tool-chain that works for you and not against you</title>
      <dc:creator>❮ ZI ❯</dc:creator>
      <pubDate>Sun, 17 Apr 2022 07:54:58 +0000</pubDate>
      <link>https://dev.to/z-shell/a-tool-chain-that-works-for-you-and-not-against-you-jnd</link>
      <guid>https://dev.to/z-shell/a-tool-chain-that-works-for-you-and-not-against-you-jnd</guid>
      <description>&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tr&gt;&lt;td&gt;
&lt;h3&gt;
&lt;a href="https://github.com/z-shell/zi"&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9oVhICzG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell.png" width="320" height="320"&gt;❮ ZI ❯&lt;/a&gt; _ 🧙‍‍♀️ _ A Swiss Army Knife for Zsh. &lt;br&gt; Designed to glue everything together.&lt;/h3&gt;



&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--whibxe6n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u5y3wharjzc3dgha9q34.png" alt="z-shell zi" width="880" height="313"&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://z.digitalclouds.dev"&gt;z.digitalclouds.dev&lt;/a&gt; | &lt;a href="https://github.com/z-shell/"&gt;GitHub&lt;/a&gt; | &lt;a href="https://github.com/orgs/z-shell/discussions/"&gt;Discussions&lt;/a&gt; | &lt;a href="https://crowdin.digitalclouds.dev"&gt;Localize&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚡️ Fast and feature-rich
&lt;/h2&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://z.digitalclouds.dev/search?q=meta+plugins"&gt;Meta plugins&lt;/a&gt; allow installing groups of plugins via a single, friendly label.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://z.digitalclouds.dev/ecosystem/packages"&gt;Packages&lt;/a&gt; offload the user from providing long and complex commands.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://z.digitalclouds.dev/ecosystem/annexes"&gt;Annexes&lt;/a&gt; allow to extend the plugin manager with new commands.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://z.digitalclouds.dev/docs/getting_started/overview#turbo-mode-zsh--53"&gt;Turbo&lt;/a&gt; mode yields &lt;strong&gt;50-80%&lt;/strong&gt; faster Zsh startup.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ☑️ Neat and flexible
&lt;/h2&gt;




&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://z.digitalclouds.dev/docs/guides/customization#customizing-paths"&gt;Customize paths&lt;/a&gt;, use &lt;a href="https://z.digitalclouds.dev/docs/guides/customization#multiple-prompts"&gt;multiple prompts&lt;/a&gt; or create &lt;a href="https://z.digitalclouds.dev/docs/guides/customization#non-github-local-plugins"&gt;your own&lt;/a&gt; plugins.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Supports &lt;a href="https://z.digitalclouds.dev/docs/getting_started/overview#oh-my-zsh-prezto"&gt;Oh My Zsh&lt;/a&gt; and &lt;a href="https://z.digitalclouds.dev/docs/getting_started/overview#oh-my-zsh-prezto"&gt;Prezto&lt;/a&gt; plugins and libraries. (&lt;a href="https://z.digitalclouds.dev/docs/getting_started/migration"&gt;migration&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Does not use &lt;code&gt;$FPATH&lt;/code&gt;, loading multiple plugins doesn't clutter &lt;code&gt;$FPATH&lt;/code&gt; with the same number of entries, e.g: 10, 15,&lt;br&gt;
or more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Code is immune to &lt;code&gt;KSH_ARRAYS&lt;/code&gt; and other options typically causing compatibility problems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do not require &lt;code&gt;sudo&lt;/code&gt;, and provide many workarounds e.g: setting so-called &lt;strong&gt;shims&lt;/strong&gt; locally.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📈 Familiarize and control
&lt;/h2&gt;




&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Visualise data: &lt;strong&gt;aliases&lt;/strong&gt;, &lt;strong&gt;functions&lt;/strong&gt;, &lt;strong&gt;bindkeys&lt;/strong&gt;, &lt;strong&gt;Zle widgets&lt;/strong&gt;, &lt;strong&gt;zstyles&lt;/strong&gt;, &lt;strong&gt;completions&lt;/strong&gt;,&lt;br&gt;
&lt;strong&gt;variables&lt;/strong&gt;, &lt;code&gt;$PATH&lt;/code&gt;, and &lt;code&gt;$FPATH&lt;/code&gt; elements a plugin has set up.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Quickly familiarize oneself with a new plugin and provides rich and easy-to-digest information that might be helpful&lt;br&gt;
on various occasions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://z.digitalclouds.dev/docs/guides/commands#loading-and-unloading"&gt;Load or unload&lt;/a&gt; plugins, use the ability to &lt;a href="https://z.digitalclouds.dev/docs/guides/commands#completions-management"&gt;manage&lt;/a&gt; completions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docker &lt;a href="https://github.com/z-shell/playground"&gt;playground&lt;/a&gt;, test or propose configurations, preview at&lt;br&gt;
&lt;a href="https://asciinema.org/a/459358"&gt;asciinema.org&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://z.digitalclouds.dev/docs/gallery/collection"&gt;https://z.digitalclouds.dev/docs/gallery/collection&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Limited to your own imagination... 🧙‍‍♀️&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;p&gt;
&lt;a href="https://github.com/z-shell/"&gt;
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--s9euvwMX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.zshell.dev/.github/plugin/followup/followup.svg" alt="Z-Shell Indepth" width="480" height="222"&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/z-shell/zw"&gt;
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dDhkafaR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.zshell.dev/.github/plugin/pagespeed/detailed.svg" alt="ZW PageSpeed" width="480" height="275"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>zsh</category>
      <category>tooling</category>
      <category>hacktoberfest</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>❮ ZI Annex - LinkBin ❯</title>
      <dc:creator>❮ ZI ❯</dc:creator>
      <pubDate>Sat, 09 Apr 2022 15:57:45 +0000</pubDate>
      <link>https://dev.to/z-shell/zi-annex-linkbin-4432</link>
      <guid>https://dev.to/z-shell/zi-annex-linkbin-4432</guid>
      <description>&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tr&gt;&lt;td&gt;
&lt;h1&gt;&lt;h3&gt;
&lt;a href="https://github.com/z-shell.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9oVhICzG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell.png" width="320" height="320"&gt;
&lt;/a&gt;❮ ZI ❯ Annex - &lt;a href="https://github.com/z-shell/z-a-linkbin"&gt;LinkBin&lt;/a&gt;
&lt;/h3&gt;&lt;/h1&gt;

&lt;h2&gt;Run programs and scripts without adding anything to &lt;code&gt;$PATH&lt;/code&gt; via the automated &lt;b&gt;links&lt;/b&gt; to &lt;code&gt;$ZPFX/bin&lt;/code&gt;
&lt;/h2&gt;

&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aA2CsnWH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dytilfp4nd285q0zzva0.png" alt="eval preview" width="844" height="261"&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://z.digitalclouds.dev"&gt;z.digitalclouds.dev&lt;/a&gt; | &lt;a href="https://github.com/z-shell/"&gt;GitHub&lt;/a&gt; | &lt;a href="https://github.com/orgs/z-shell/discussions/"&gt;Discussions&lt;/a&gt; | &lt;a href="https://crowdin.digitalclouds.dev"&gt;Localize&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi light z-shell/z-a-linkbin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  💡 Wiki
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://z.digitalclouds.dev/docs/ecosystem/annexes"&gt;annexes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;Exposing a binary program without modifying &lt;code&gt;$PATH&lt;/code&gt; – &lt;code&gt;z-a-linkbin&lt;/code&gt; will automatically create a hard or soft link to the binary in &lt;code&gt;$ZPFX/bin&lt;/code&gt; exposing the program to the command line as if it were being placed in &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The command can then be accessed normally – not only in the live Zsh session, but also from any Zsh script.&lt;/p&gt;

&lt;p&gt;The ice-modifier &lt;code&gt;lbin''&lt;/code&gt; provided by the annex creates &lt;code&gt;links&lt;/code&gt; for binaries and scripts.&lt;/p&gt;

&lt;p&gt;It creates the &lt;code&gt;link&lt;/code&gt; that calls the actual binary.&lt;br&gt;
The link is created always under the same, standard and single &lt;code&gt;$PATH&lt;/code&gt; entry: &lt;code&gt;$ZPFX/bin&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The optional preceding &lt;code&gt;!&lt;/code&gt; flag means create a soft link instead of a hard link.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi ice from&lt;span class="s1"&gt;'gh-r'&lt;/span&gt; lbin&lt;span class="s1"&gt;'!fzf'&lt;/span&gt;
zi load junegunn/fzf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; &lt;span class="nv"&gt;$ZPFX&lt;/span&gt;/bin/ | &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'{print $(NF-2),$(NF-1),$NF}'&lt;/span&gt;
fzf &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The ice can contain globs&lt;/strong&gt;. It will expand these when searching for the binary.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi ice from&lt;span class="s1"&gt;'gh-r'&lt;/span&gt; lbin&lt;span class="s1"&gt;'**fzf -&amp;gt; myfzf'&lt;/span&gt;
zi load junegunn/fzf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nv"&gt;$ZPFX&lt;/span&gt;/bin
myfzf &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The ice can be empty&lt;/strong&gt;. It will then try to create the link:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;trailing component of the &lt;code&gt;id_as&lt;/code&gt; ice, e.g.: &lt;code&gt;id_as'exts/git-my'&lt;/code&gt; → it will check if a file &lt;code&gt;git-my&lt;/code&gt; exists and if yes, create the link &lt;code&gt;git-my&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;the plugin name, e.g.: for &lt;code&gt;paulirish/git-open&lt;/code&gt; it'll check if a file &lt;code&gt;git-open&lt;/code&gt; exists and if yes, create the link &lt;code&gt;git-open&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;trailing component of the snippet URL,&lt;/li&gt;
&lt;li&gt;for any alphabetically first executable file.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Above also applies if just &lt;code&gt;!&lt;/code&gt; were passed.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;blockquote&gt;
&lt;p&gt;This repository compatible with &lt;a href="https://github.com/z-shell/zi"&gt;ZI&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Have the best and leave the rest!&lt;/p&gt;

</description>
      <category>zsh</category>
      <category>tooling</category>
      <category>hacktoberfest</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>❮ ZI Annex - Eval ❯</title>
      <dc:creator>❮ ZI ❯</dc:creator>
      <pubDate>Sat, 09 Apr 2022 09:09:29 +0000</pubDate>
      <link>https://dev.to/z-shell/zi-annex-eval-46co</link>
      <guid>https://dev.to/z-shell/zi-annex-eval-46co</guid>
      <description>&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;
  &lt;h3&gt;
  &lt;a href="https://github.com/z-shell.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9oVhICzG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell.png" width="320" height="320"&gt;
&lt;/a&gt;❮ ZI ❯ Annex - 
&lt;a href="https://github.com/z-shell/z-a-eval"&gt;Eval&lt;/a&gt;
  &lt;/h3&gt;



&lt;h2&gt;Allows to cache the output of arbitrarily slow initialization command to speed up shell startup time.
&lt;/h2&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7_kPR--o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2rdnavhzmpjnogor28z1.png" alt="eval preview" width="587" height="98"&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://z.digitalclouds.dev"&gt;z.digitalclouds.dev&lt;/a&gt; | &lt;a href="https://github.com/z-shell/"&gt;GitHub&lt;/a&gt; | &lt;a href="https://github.com/orgs/z-shell/discussions/"&gt;Discussions&lt;/a&gt; | &lt;a href="https://crowdin.digitalclouds.dev"&gt;Localize&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Annex provides a completion file with the prefix _zi, the 'shim' below which will run all available zi completions and the shim is assigned as ZIs completion with a compdef call&lt;/p&gt;

&lt;p&gt;Synopsis:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi recache &amp;lt;plugin/snippet&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  💡 Wiki
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://z.digitalclouds.dev/docs/ecosystem/annexes"&gt;annexes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Simply load like a regular plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi light z-shell/z-a-eval
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After executing this command you can then use the new ice-mods provided by the annex.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;The output of a slow initialization command is redirected to a file located within the plugin/snippets directory and sourced while loading. The next time the plugin/snippet is loaded, this file will be sourced skipping the need to run the initialization command.&lt;/p&gt;

&lt;p&gt;The ice-modifier &lt;code&gt;eval''&lt;/code&gt; provided and handled by this annex creates a &lt;code&gt;cache&lt;/code&gt; in the plugin/snippets root directory which stores the commands output.&lt;/p&gt;

&lt;p&gt;This cache is regenerated when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The plugin/snippet is updated.&lt;/li&gt;
&lt;li&gt;The cache file is removed.&lt;/li&gt;
&lt;li&gt;With the new ZI subcommand &lt;code&gt;recache&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The optional preceding &lt;code&gt;!&lt;/code&gt; flag means to store command output regardless of exit code. Otherwise &lt;code&gt;eval''&lt;/code&gt; will avoid caching ouput of code which returns a non-zero exit code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Example Invocations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Without z-a-eval
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi ice as&lt;span class="s2"&gt;"command"&lt;/span&gt; from&lt;span class="s2"&gt;"gh-r"&lt;/span&gt; &lt;span class="nb"&gt;mv&lt;/span&gt;&lt;span class="s2"&gt;"zoxide* -&amp;gt; zoxide"&lt;/span&gt;  &lt;span class="se"&gt;\&lt;/span&gt;
  atclone&lt;span class="s2"&gt;"./zoxide init zsh &amp;gt; init.zsh"&lt;/span&gt;  atpull&lt;span class="s2"&gt;"%atclone"&lt;/span&gt; src&lt;span class="s2"&gt;"init.zsh"&lt;/span&gt; nocompile&lt;span class="s1"&gt;'!'&lt;/span&gt;
zi light ajeetdsouza/zoxide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi ice atclone&lt;span class="s2"&gt;"dircolors -b LS_COLORS &amp;gt; init.zsh"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  atpull&lt;span class="s2"&gt;"%atclone"&lt;/span&gt; pick&lt;span class="s2"&gt;"init.zsh"&lt;/span&gt; nocompile&lt;span class="s1"&gt;'!'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  atload&lt;span class="s1"&gt;'zstyle ":completion:*" list-colors “${(s.:.)LS_COLORS}”'&lt;/span&gt;
zi light trapd00r/LS_COLORS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  With z-a-eval
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi ice as&lt;span class="s2"&gt;"command"&lt;/span&gt; from&lt;span class="s2"&gt;"gh-r"&lt;/span&gt; &lt;span class="nb"&gt;mv&lt;/span&gt;&lt;span class="s2"&gt;"zoxide* -&amp;gt; zoxide"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="s2"&gt;"./zoxide init zsh"&lt;/span&gt;
zi light ajeetdsouza/zoxide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi ice &lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="s2"&gt;"dircolors -b LS_COLORS"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  atload&lt;span class="s1"&gt;'zstyle ":completion:*" list-colors “${(s.:.)LS_COLORS}”'&lt;/span&gt;
zi light trapd00r/LS_COLORS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Without ZI
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="p"&gt;+commands[kubectl]&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; 1 &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;kubectl completion zsh&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  With ZI and z-a-eval
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;## Updated during `zi update`&lt;/span&gt;
zi ice id-as&lt;span class="s2"&gt;"kubectl_completion"&lt;/span&gt; has&lt;span class="s2"&gt;"kubectl"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="s2"&gt;"kubectl completion zsh"&lt;/span&gt; run-atpull
zi light z-shell/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;This repository compatible with &lt;a href="https://github.com/z-shell/zi"&gt;ZI&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Have the best and leave the rest!&lt;/p&gt;

</description>
      <category>zsh</category>
      <category>performance</category>
      <category>hacktoberfest</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>❮Doxygen For Shell Scripts❯</title>
      <dc:creator>❮ ZI ❯</dc:creator>
      <pubDate>Fri, 08 Apr 2022 02:57:04 +0000</pubDate>
      <link>https://dev.to/z-shell/doxygen-for-shell-scripts-57c0</link>
      <guid>https://dev.to/z-shell/doxygen-for-shell-scripts-57c0</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/z-shell/zi" rel="noopener noreferrer"&gt;&lt;br&gt;
  &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fz-shell%2Fzi%2Fmain%2Fdocs%2Fimages%2Flogo.png" alt="Logo"&gt;&lt;img&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://z.digitalclouds.dev" rel="noopener noreferrer"&gt;z.digitalclouds.dev&lt;/a&gt; | &lt;a href="https://github.com/z-shell/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; | &lt;a href="https://github.com/orgs/z-shell/discussions/" rel="noopener noreferrer"&gt;Discussions&lt;/a&gt; | &lt;a href="https://crowdin.digitalclouds.dev" rel="noopener noreferrer"&gt;Localize&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;If there was a tool that parses scripts and extracts comments so it can be documented, collaborated, or used as a manual? If all can be automated so you can concentrate on the code while docs are made on the go? We got your back...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Contribute to make it better and get extra tools from our projects which are shared between contributors. &lt;br&gt;
Code-newbies with the right attitude is always welcome. &lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Doxygen For Shell Scripts**
&lt;/h1&gt;




&lt;blockquote&gt;
&lt;p&gt;Example of our Z Shell code - &lt;a href="https://z.digitalclouds.dev/docs/code" rel="noopener noreferrer"&gt;https://z.digitalclouds.dev/docs/code&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Parses &lt;code&gt;Zsh&lt;/code&gt; and &lt;code&gt;Bash&lt;/code&gt; scripts, outputs &lt;code&gt;Asciidoc&lt;/code&gt; document with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;list of functions, including auto-loading functions,&lt;/li&gt;
&lt;li&gt;call trees of functions and script body,&lt;/li&gt;
&lt;li&gt;comments for functions,&lt;/li&gt;
&lt;li&gt;features used for each function and for script body (features like: &lt;code&gt;eval&lt;/code&gt;, &lt;code&gt;read&lt;/code&gt;, &lt;code&gt;vared&lt;/code&gt;, &lt;code&gt;shopt&lt;/code&gt;, etc.),&lt;/li&gt;
&lt;li&gt;distinct marks for hooks registered with &lt;code&gt;add-zsh-hook&lt;/code&gt; (Zsh),&lt;/li&gt;
&lt;li&gt;list of exported variables,&lt;/li&gt;
&lt;li&gt;list of used exported variables, together with the variable's origin (i.e. possibly another script).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Call trees support cross-file invocations, i.e. when a script calls a function defined in another file.&lt;/p&gt;

&lt;p&gt;Written in &lt;code&gt;Zshell&lt;/code&gt; language.&lt;/p&gt;




&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;




&lt;p&gt;Default install path-prefix is &lt;code&gt;/usr/local&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/z-shell/zsdoc
&lt;span class="nb"&gt;cd &lt;/span&gt;doc
make
&lt;span class="nb"&gt;sudo &lt;/span&gt;make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For custom &lt;code&gt;PREFIX&lt;/code&gt; variable in &lt;code&gt;make&lt;/code&gt; invocation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# 'sudo' may be required to install

make install PREFIX=~/opt/local
install -c -d ~/opt/local/share/zsdoc
install -c -d ~/opt/local/share/doc/zsdoc

cp build/zsd build/zsd-transform build/zsd-detect build/zsd-to-adoc ~/opt/local/bin
cp README.md NEWS LICENSE ~/opt/local/share/doc/zsdoc
cp zsd.config ~/opt/local/share/zsdoc

➜ cd ~/opt/local

➜ tree.
        ├── bin
        │   ├── zsd
        │   ├── zsd-detect
        │   ├── zsd-to-adoc
        │   └── zsd-transform
        │
        └── share
           ├── doc
           │   └── zsdoc
           │       ├── LICENSE
           │       ├── NEWS
           │       └── README.md
           │
           └── zsdoc
               └── zsd.config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Other available &lt;code&gt;make&lt;/code&gt; variables are: &lt;code&gt;INSTALL&lt;/code&gt; (to customize install command), &lt;code&gt;BIN_DIR&lt;/code&gt;, &lt;code&gt;SHARE_DIR&lt;/code&gt;, &lt;code&gt;DOC_DIR&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;






&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zsd &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;-h&lt;/span&gt;/--help] &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;-v&lt;/span&gt;/--verbose] &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;-q&lt;/span&gt;/--quiet] &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;-n&lt;/span&gt;/--noansi] &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;--cignore&lt;/span&gt; &amp;lt;pattern&amp;gt;] &lt;span class="o"&gt;{&lt;/span&gt;file1&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;file2] ...

The files will be processed and their documentation will be generated &lt;span class="k"&gt;in &lt;/span&gt;subdirectory &lt;span class="sb"&gt;`&lt;/span&gt;zsdoc&lt;span class="s1"&gt;' (with meta-data in subdirectory `data'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Options:
&lt;span class="nt"&gt;-h&lt;/span&gt;/--help      Usage information
&lt;span class="nt"&gt;-v&lt;/span&gt;/--verbose   More verbose operation-status output
&lt;span class="nt"&gt;-q&lt;/span&gt;/--quiet     No status messages
&lt;span class="nt"&gt;-n&lt;/span&gt;/--noansi    No colors &lt;span class="k"&gt;in &lt;/span&gt;terminal output
&lt;span class="nt"&gt;--cignore&lt;/span&gt;      Specify which comment lines should be ignored
&lt;span class="nt"&gt;-f&lt;/span&gt;/--fpath     Paths are separated by: pointing to directories with functions
&lt;span class="nt"&gt;--synopsis&lt;/span&gt;     Text to be used &lt;span class="k"&gt;in &lt;/span&gt;the SYNOPSIS section. Line &lt;span class="nb"&gt;break&lt;/span&gt; &lt;span class="s2"&gt;"... +&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;, paragraph &lt;span class="s2"&gt;"...&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nt"&gt;--scomm&lt;/span&gt;        Strip comment char &lt;span class="s2"&gt;"#"&lt;/span&gt; from &lt;span class="k"&gt;function &lt;/span&gt;comments
&lt;span class="nt"&gt;--bash&lt;/span&gt;         Output is slightly tailored to Bash specifics &lt;span class="o"&gt;(&lt;/span&gt;instead of Zsh specifics&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example &lt;code&gt;--cignore&lt;/code&gt; options:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nt"&gt;--cignore&lt;/span&gt; &lt;span class="s1"&gt;'\#*FUNCTION:*{{{*'&lt;/span&gt;                 - ignore comments like &lt;span class="c"&gt;# FUNCTION: usage {{{&lt;/span&gt;
&lt;span class="nt"&gt;--cignore&lt;/span&gt; &lt;span class="s1"&gt;'(\#*FUNCTION:*{{{*|\#*FUN:*{{{*)'&lt;/span&gt;  - also ignore comments like: &lt;span class="c"&gt;# FUN: usage {{{&lt;/span&gt;

The file is parsed &lt;span class="k"&gt;for &lt;/span&gt;synopsis block, which can be e.g.:
&lt;span class="c"&gt;# synopsis {{{my synopsis, can be multi-line}}}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another block that is parsed is commenting on environment variables. It consists of multiple&lt;br&gt;
"VAR_NAME -&amp;gt; var description" lines and results in a table in the output AsciiDoc document.&lt;/p&gt;




&lt;p&gt;Example:&lt;/p&gt;






&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# env-vars {{{&lt;/span&gt;
&lt;span class="c"&gt;# PATH -&amp;gt; paths to executables&lt;/span&gt;
&lt;span class="c"&gt;# MANPATH -&amp;gt; paths to manuals }}}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change the default brace block-delimiters with &lt;code&gt;--blocka&lt;/code&gt;, &lt;code&gt;--blockb&lt;/code&gt;. Block body should be AsciiDoc.&lt;/p&gt;




&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;




&lt;p&gt;&lt;a href="https://github.com/z-shell/zsdoc/blob/main/examples/zsh-syntax-highlighting.zsh.adoc" rel="noopener noreferrer"&gt;example 1&lt;/a&gt;,&lt;br&gt;
&lt;a href="https://github.com/z-shell/zsdoc/blob/main/examples/zsh-autosuggestions.zsh.adoc" rel="noopener noreferrer"&gt;example 2&lt;/a&gt;&lt;br&gt;
(also in &lt;strong&gt;PDF&lt;/strong&gt;:&lt;br&gt;
&lt;a href="https://raw.githubusercontent.com/z-shell/zsdoc/main/examples/zsh-syntax-highlighting.zsh.pdf" rel="noopener noreferrer"&gt;example 1&lt;/a&gt;,&lt;br&gt;
&lt;a href="https://raw.githubusercontent.com/z-shell/zsdoc/main/examples/zsh-autosuggestions.zsh.pdf" rel="noopener noreferrer"&gt;example 2&lt;/a&gt;).&lt;/p&gt;




&lt;h2&gt;
  
  
  Few Rules
&lt;/h2&gt;




&lt;p&gt;Few rules helping to use &lt;code&gt;zsdoc&lt;/code&gt; in your project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write function comments before function. Empty lines between comment and function are allowed.&lt;/li&gt;
&lt;li&gt;If you use special comments, e.g. &lt;code&gt;vim&lt;/code&gt; (or &lt;code&gt;emacs-origami&lt;/code&gt;) &lt;strong&gt;folds&lt;/strong&gt;, you can ignore these lines with &lt;code&gt;--cignore&lt;/code&gt; (see &lt;a href="https://github.com/z-shell/zsdoc#usage" rel="noopener noreferrer"&gt;Usage&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;If it's possible to avoid &lt;code&gt;eval&lt;/code&gt;, then do that – &lt;code&gt;zsdoc&lt;/code&gt; will analyze more code.&lt;/li&gt;
&lt;li&gt;Currently, functions defined in functions are ignored, but this will change shortly.&lt;/li&gt;
&lt;li&gt;I've greatly optimized the new &lt;code&gt;Zsh&lt;/code&gt; version (&lt;code&gt;5.4.2&lt;/code&gt;) for data processing – &lt;code&gt;zsdoc&lt;/code&gt; parse long sources very fast starting from that &lt;code&gt;Zsh&lt;/code&gt; version.&lt;/li&gt;
&lt;li&gt;If you have multiple &lt;code&gt;Zsh&lt;/code&gt; versions installed, then (for example) set &lt;code&gt;zsh_control_bin="/usr/local/bin/zsh-5.4.2"&lt;/code&gt; in &lt;code&gt;/usr/local/share/zsdoc/zsd.config&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Be aware that to convert a group of scripts, you simply need &lt;code&gt;zsd file1.zsh file2.zsh ...&lt;/code&gt; – cross-file function invocations will work automatically, and multiple &lt;code&gt;*.adoc&lt;/code&gt; files will be created.&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;Makefile&lt;/code&gt; with &lt;code&gt;doc&lt;/code&gt; target, that does &lt;code&gt;rm -rf zsdoc/data; zsd -v file1.zsh ...&lt;/code&gt;. Documentation will land in &lt;code&gt;zsdoc&lt;/code&gt; directory.&lt;/li&gt;
&lt;li&gt;Directory &lt;code&gt;zsdoc/data&lt;/code&gt; holds meta-data used to create &lt;code&gt;asciidoc&lt;/code&gt; documents (&lt;code&gt;*.adoc&lt;/code&gt; files). You can remove it or analyze it yourself.&lt;/li&gt;
&lt;li&gt;Obtain &lt;strong&gt;PDFs&lt;/strong&gt; with &lt;a href="http://asciidoctor.org/" rel="noopener noreferrer"&gt;Asciidoctor&lt;/a&gt; tool via: &lt;code&gt;asciidoctor -b pdf -r asciidoctor-pdf file1.zsh.adoc&lt;/code&gt;. Install &lt;code&gt;Asciidoctor&lt;/code&gt; with: &lt;code&gt;gem install asciidoctor-pdf --pre&lt;/code&gt;. (Check out &lt;a href="https://github.com/z-shell/docs/blob/main/code/Makefile" rel="noopener noreferrer"&gt;ZI's Makefile&lt;/a&gt;.)&lt;/li&gt;
&lt;li&gt;HTML: &lt;code&gt;asciidoctor script.adoc&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Obtain manual pages with &lt;code&gt;Asciidoc&lt;/code&gt; package via: &lt;code&gt;a2x -L --doctype manpage --format manpage file1.zsh.adoc&lt;/code&gt; (&lt;code&gt;asciidoc&lt;/code&gt; is a common package; its &lt;code&gt;a2x&lt;/code&gt; command is little slow).&lt;/li&gt;
&lt;li&gt;Github supports &lt;code&gt;Asciidoc&lt;/code&gt; documents and renders them automatically.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>zsh</category>
      <category>bash</category>
      <category>hacktoberfest</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>❮ ZI Annex - Test ❯</title>
      <dc:creator>❮ ZI ❯</dc:creator>
      <pubDate>Thu, 07 Apr 2022 07:46:47 +0000</pubDate>
      <link>https://dev.to/z-shell/zi-annex-test-3715</link>
      <guid>https://dev.to/z-shell/zi-annex-test-3715</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/z-shell/zi"&gt;&lt;br&gt;
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MzzdUg8g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/z-shell/zi/main/docs/images/logo.png" alt="Logo" width="128" height="128"&gt;&lt;img&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://z.digitalclouds.dev"&gt;z.digitalclouds.dev&lt;/a&gt; | &lt;a href="https://github.com/z-shell/"&gt;GitHub&lt;/a&gt; | &lt;a href="https://github.com/orgs/z-shell/discussions/"&gt;Discussions&lt;/a&gt; | &lt;a href="https://crowdin.digitalclouds.dev"&gt;Localize&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Run tests after install, setup your own or propose missing.&lt;br&gt;
With always go like pro.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tr&gt;&lt;td&gt;
❮ ZI ❯ Annex - Test &lt;h3&gt; 
&lt;/h3&gt;
&lt;p&gt;An annex that runs tests via make or zunit&lt;/p&gt; If any found – after installing and updating
a plugin or snippet. 
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iL7M7VBe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://user-images.githubusercontent.com/59910950/162143845-c44ead50-b21a-46c0-8372-18325eb1f33a.gif" alt="Preview" width="863" height="703"&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  Install
&lt;/h3&gt;

&lt;p&gt;Zunit install if missing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi &lt;span class="k"&gt;for&lt;/span&gt; @zunit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi light z-shell/z-a-test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;To run the tests in a verbose mode, issue:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zstyle :zi:annex:test quiet 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;before installing or updating the plugin. To skip tests for a single plugin,&lt;br&gt;
add &lt;code&gt;notest&lt;/code&gt; ice:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi ice notest
zi load …
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;

&lt;p&gt;Example activation in the default quiet mode:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DRaILtRx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/z-shell/z-a-test/main/docs/images/z-p-test-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DRaILtRx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/z-shell/z-a-test/main/docs/images/z-p-test-1.png" alt="z-a-test activation" width="880" height="73"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example activation in non-quiet mode:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RM48Jx8Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/z-shell/z-a-test/main/docs/images/z-p-test-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RM48Jx8Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/z-shell/z-a-test/main/docs/images/z-p-test-2.png" alt="z-a-test activation" width="880" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>zsh</category>
      <category>hacktoberfest</category>
      <category>contributorswanted</category>
      <category>devops</category>
    </item>
    <item>
      <title>❮ ZI - Zsh String Lib ❯</title>
      <dc:creator>❮ ZI ❯</dc:creator>
      <pubDate>Thu, 31 Mar 2022 02:26:04 +0000</pubDate>
      <link>https://dev.to/z-shell/zi-zsh-string-lib-52hl</link>
      <guid>https://dev.to/z-shell/zi-zsh-string-lib-52hl</guid>
      <description>&lt;h2&gt;
  &lt;a href="https://github.com/z-shell/zi" rel="noopener noreferrer"&gt;
  &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fz-shell%2Fzi%2Fmain%2Fdocs%2Fimages%2Flogo.png" alt="Logo"&gt;&lt;img&gt;&lt;/a&gt;
❮ ZI ❯ Zsh String Lib 
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://z.digitalclouds.dev" rel="noopener noreferrer"&gt;https://z.digitalclouds.dev&lt;/a&gt; | &lt;a href="https://github.com/z-shell" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; | &lt;a href="https://twitter.com/zshell_zi" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  JSON Parsing
&lt;/h2&gt;




&lt;p&gt;❮ ZI ❯ has it's own &lt;a href="https://z.digitalclouds.dev/docs/ecosystem/packages/packages" rel="noopener noreferrer"&gt;ecosystem of packages&lt;/a&gt;, and here is how you can create your own - 'package.json'.&lt;/p&gt;

&lt;p&gt;A string library for Zsh. Its founding function was parsing of JSON.&lt;/p&gt;

&lt;h3&gt;
  
  
  List Of The Functions
&lt;/h3&gt;




&lt;h3&gt;
  
  
  @str-parse-json
&lt;/h3&gt;

&lt;p&gt;Parses the buffer (&lt;code&gt;$1&lt;/code&gt;) with JSON and returns:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fields for the given key (&lt;code&gt;$2&lt;/code&gt;) in the given hash (&lt;code&gt;$3&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The hash looks like follows:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   1/1 → strings at the level 1 of the 1st object
   1/2 → strings at the level 1 of the 2nd object
   …
   2/1 → strings at 2nd level of the 1st object
   …
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The strings are parse-able with &lt;code&gt;"${(@Q)${(@z)value}"&lt;/code&gt;, i.e.: they're concatenated and quoted strings found in the JSON.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"zi-ices"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"default"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"wait"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"lucid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"as"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"program"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"pick"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"fzy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"make"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"bgn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"wait"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"lucid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"as"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"null"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"make"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"sbin"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"fzy;contrib/fzy-*"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Will result in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;local&lt;/span&gt; &lt;span class="nt"&gt;-A&lt;/span&gt; Strings
Strings[1/1]&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"zi-ices"&lt;/span&gt;
Strings[2/1]&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"default &lt;/span&gt;&lt;span class="nv"&gt;$'&lt;/span&gt;&lt;span class="se"&gt;\0&lt;/span&gt;&lt;span class="s2"&gt;'--object--&lt;/span&gt;&lt;span class="nv"&gt;$'&lt;/span&gt;&lt;span class="se"&gt;\0&lt;/span&gt;&lt;span class="s2"&gt;' bgn &lt;/span&gt;&lt;span class="nv"&gt;$'&lt;/span&gt;&lt;span class="se"&gt;\0&lt;/span&gt;&lt;span class="s2"&gt;'--object--&lt;/span&gt;&lt;span class="nv"&gt;$'&lt;/span&gt;&lt;span class="se"&gt;\0&lt;/span&gt;&lt;span class="s2"&gt;'"&lt;/span&gt;
Strings[3/1]&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'wait 1 lucid \  as program pick fzy make \ '&lt;/span&gt;
Strings[3/2]&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'wait 1 lucid \  as null make \  sbin fzy\;contrib/fzy-\*'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So that when you e.g.: expect a key &lt;code&gt;bgn&lt;/code&gt; but don't know at which position, you can do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;local&lt;/span&gt; &lt;span class="nt"&gt;-A&lt;/span&gt; Strings
@str-parse-json &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$json&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"zi-ices"&lt;/span&gt; Strings
integer pos
&lt;span class="c"&gt;# (I) flag returns index at which the `bgn' string&lt;/span&gt;
&lt;span class="c"&gt;# has been found in the array – the result of the&lt;/span&gt;
&lt;span class="c"&gt;# (z)-split of the Strings[2/1] string&lt;/span&gt;
&lt;span class="nv"&gt;pos&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${${&lt;/span&gt;&lt;span class="p"&gt;(@Q)&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="p"&gt;(@z)Strings[2/1]&lt;/span&gt;&lt;span class="k"&gt;}}&lt;/span&gt;&lt;span class="p"&gt;[(I)bgn]&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;((&lt;/span&gt; pos &lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;local&lt;/span&gt; &lt;span class="nt"&gt;-A&lt;/span&gt; ices
  &lt;span class="nv"&gt;ices&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="p"&gt;(@Q)&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="p"&gt;(@z)Strings[3/&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;pos+1&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="k"&gt;))&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="k"&gt;}}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="c"&gt;# Use the `ices' hash holding the values of the `bgn' object&lt;/span&gt;
  …
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that the &lt;code&gt;$'\0'&lt;/code&gt; is correctly dequoted by &lt;code&gt;Q&lt;/code&gt; flag into the null byte.&lt;/p&gt;

&lt;p&gt;Arguments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The buffer with JSON.&lt;/li&gt;
&lt;li&gt;The key in the JSON that should be mapped to the result (i.e.: it's possible
to map only a subset of the input). It must be the first key in the object to
map.&lt;/li&gt;
&lt;li&gt;The name of the output hash parameter.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  @str-read-all
&lt;/h3&gt;

&lt;p&gt;Consumes whole data from given file descriptor and stores the string under the&lt;br&gt;
given (&lt;code&gt;$2&lt;/code&gt;) parameter, which is &lt;code&gt;REPLY&lt;/code&gt; by default.&lt;/p&gt;

&lt;p&gt;The reason to create this function is speed – it's much faster than &lt;code&gt;read -d ''&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It can try hard to read the whole data by retrying multiple times (&lt;code&gt;10&lt;/code&gt; by&lt;br&gt;
default) and sleeping before each retry (not done by default).&lt;/p&gt;

&lt;p&gt;Arguments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;File descriptor (a number; use &lt;code&gt;1&lt;/code&gt; for stdin) to be read from.&lt;/li&gt;
&lt;li&gt;Name of output variable (default: &lt;code&gt;REPLY&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Numer of retries (default: &lt;code&gt;10&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Sleep time after each retry (a float; default: &lt;code&gt;0&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;FD&lt;span class="o"&gt;}&lt;/span&gt;&amp;lt; &lt;span class="o"&gt;=(&lt;/span&gt; &lt;span class="nb"&gt;cat&lt;/span&gt; /etc/motd &lt;span class="o"&gt;)&lt;/span&gt;
@str-read-all &lt;span class="nv"&gt;$FD&lt;/span&gt;
print &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nv"&gt;$REPLY&lt;/span&gt;
…
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  @str-ng-match
&lt;/h3&gt;

&lt;p&gt;Returns a non-greedy match of the given pattern (&lt;code&gt;$2&lt;/code&gt;) in the given string (&lt;code&gt;$1&lt;/code&gt;).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The string to match in.&lt;/li&gt;
&lt;li&gt;The pattern to match in the string.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Return value:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;$REPLY&lt;/code&gt; – the matched string, if found,&lt;/li&gt;
&lt;li&gt;return code: &lt;code&gt;0&lt;/code&gt; if there was a match found, otherwise &lt;code&gt;1&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; @str-ng-match &lt;span class="s2"&gt;"abb"&lt;/span&gt; &lt;span class="s2"&gt;"a*b"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;print &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nv"&gt;$REPLY&lt;/span&gt;
&lt;span class="k"&gt;fi
&lt;/span&gt;Output: ab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  @str-ng-matches
&lt;/h3&gt;

&lt;p&gt;Returns all non-greedy matches of the given pattern in the given list of&lt;br&gt;
strings.&lt;/p&gt;

&lt;p&gt;Input:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;$1&lt;/code&gt; … &lt;code&gt;$n-1&lt;/code&gt; - the strings to match in,&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$n&lt;/code&gt; - the pattern to match in the strings.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Return value:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;$reply&lt;/code&gt; – contains all the matches,&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$REPLY&lt;/code&gt; - holds the first match,&lt;/li&gt;
&lt;li&gt;return code: &lt;code&gt;0&lt;/code&gt; if there was any match found, otherwise &lt;code&gt;1&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt; a1xx ayy a2xx &lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; @str-ng-matches &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[@]&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; &lt;span class="s2"&gt;"a*x"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
   &lt;/span&gt;print &lt;span class="nt"&gt;-rl&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nv"&gt;$reply&lt;/span&gt;
&lt;span class="k"&gt;fi
&lt;/span&gt;Outout:
a1x
a2x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  @str-read-ini
&lt;/h3&gt;

&lt;p&gt;Reads an INI file.&lt;/p&gt;

&lt;p&gt;Arguments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Path to the ini file to parse.&lt;/li&gt;
&lt;li&gt;Name of output hash (&lt;code&gt;INI&lt;/code&gt; by default).&lt;/li&gt;
&lt;li&gt;Prefix for keys in the hash (can be empty).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Writes to given hash under keys built in following way: &lt;code&gt;${3}&amp;lt;section&amp;gt;_field&lt;/code&gt;.&lt;br&gt;
Values are the values from the ini file.&lt;/p&gt;


&lt;h3&gt;
  
  
  @str-read-toml
&lt;/h3&gt;

&lt;p&gt;Reads a TOML file with support for single-level array.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Path to the TOML file to parse.&lt;/li&gt;
&lt;li&gt;Name of output hash (&lt;code&gt;TOML&lt;/code&gt; by default).&lt;/li&gt;
&lt;li&gt;Prefix for keys in the hash (can be empty).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Writes to given hash under keys built in following way: &lt;code&gt;${3}&amp;lt;section&amp;gt;_field&lt;/code&gt;.&lt;br&gt;
Values are the values from the TOML file.&lt;/p&gt;

&lt;p&gt;The values can be quoted and concatenated strings if they're an array. For&lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[sec]&lt;/span&gt;
&lt;span class="py"&gt;array&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;[ val1, "value 2", value&amp;amp;3 ]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then the fields of the hash will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;TOML[&amp;lt;sec&amp;gt;_array]&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"val1 value&lt;/span&gt;&lt;span class="se"&gt;\ &lt;/span&gt;&lt;span class="s2"&gt;2 value&lt;/span&gt;&lt;span class="se"&gt;\&amp;amp;&lt;/span&gt;&lt;span class="s2"&gt;3"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To retrieve the array stored in such way, use the substitution &lt;code&gt;"${(@Q)${(@z)TOML[&amp;lt;sec&amp;gt;_array]}}"&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;local&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; array
&lt;span class="nv"&gt;array&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="p"&gt;(@Q)&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="p"&gt;(@z)TOML[&amp;lt;sec&amp;gt;_array]&lt;/span&gt;&lt;span class="k"&gt;}}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(The substitution first splits the input string as if Zsh would split it on the command line – with the &lt;code&gt;(z)&lt;/code&gt; flag, and then removes one level of quoting with the &lt;code&gt;(Q)&lt;/code&gt; flag).&lt;/p&gt;




&lt;h3&gt;
  
  
  @str-dump
&lt;/h3&gt;

&lt;p&gt;Dumps the contents of the variable, whether it's being a scalar, an array or&lt;br&gt;
a hash. The contents of the hash are sorted on the keys numerically, i.e.: by&lt;br&gt;
using &lt;code&gt;(on)&lt;/code&gt; flags.&lt;/p&gt;

&lt;p&gt;An option &lt;code&gt;-q&lt;/code&gt; can be provided: it'll enable quoting of the printed data with&lt;br&gt;
the &lt;code&gt;q&lt;/code&gt;-flag (i.e.: backslash quoting).&lt;/p&gt;

&lt;p&gt;Basically, the function Is an alternative to &lt;code&gt;declare -p&lt;/code&gt;, with a different&lt;br&gt;
output format, more dump-like.&lt;/p&gt;

&lt;p&gt;Arguments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The name of the variable of which contents should be dumped.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;array&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="s2"&gt;"a value"&lt;/span&gt; &lt;span class="s2"&gt;"test"&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt;
@str-dump &lt;span class="nt"&gt;-q&lt;/span&gt; array
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;''
a\ value
test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;typeset&lt;/span&gt; &lt;span class="nt"&gt;-A&lt;/span&gt; &lt;span class="nb"&gt;hash&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt; &lt;span class="s2"&gt;"a key"&lt;/span&gt; &lt;span class="s2"&gt;"a value"&lt;/span&gt; key value &lt;span class="o"&gt;)&lt;/span&gt;
@str-dump &lt;span class="nt"&gt;-q&lt;/span&gt; &lt;span class="nb"&gt;hash&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a\ key: a\ value
key: value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>zsh</category>
      <category>tooling</category>
      <category>hacktoberfest</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>✨ ❮ Feature-rich Syntax Highlighting ❯</title>
      <dc:creator>❮ ZI ❯</dc:creator>
      <pubDate>Wed, 30 Mar 2022 07:21:00 +0000</pubDate>
      <link>https://dev.to/z-shell/feature-rich-syntax-highlighting-4fm6</link>
      <guid>https://dev.to/z-shell/feature-rich-syntax-highlighting-4fm6</guid>
      <description>&lt;h1&gt;
  &lt;a href="https://github.com/z-shell/zi"&gt;
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MzzdUg8g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/z-shell/zi/main/docs/images/logo.png" alt="Logo" width="128" height="128"&gt;&lt;/a&gt;
&lt;/h1&gt;




&lt;ul&gt;
&lt;li&gt;&lt;a href="https://wiki.zshell.dev"&gt;https://wiki.zshell.dev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/z-shell"&gt;https://github.com/z-shell&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/z-shell/F-Sy-H"&gt;https://github.com/z-shell/F-Sy-H&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  Fast-Syntax-Highlighting Themes (Zshell)
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://asciinema.org/a/183814"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wCZXIKf0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://asciinema.org/a/183814.svg" width="835" height="470"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h4&gt;
  
  
  Recursive fast-syntax-highlighting, highlights code passed to sh -c
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://asciinema.org/a/186349"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Gvg17RIq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://asciinema.org/a/186349.svg" width="649" height="372"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;
Installation

&lt;ul&gt;
&lt;li&gt;Manual&lt;/li&gt;
&lt;li&gt;ZI&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
Features

&lt;ul&gt;
&lt;li&gt;Themes&lt;/li&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Brackets&lt;/li&gt;
&lt;li&gt;Conditions&lt;/li&gt;
&lt;li&gt;Strings&lt;/li&gt;
&lt;li&gt;here-strings&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;exec&lt;/code&gt; descriptor-variables&lt;/li&gt;
&lt;li&gt;for-loops and alternate syntax (brace &lt;code&gt;{&lt;/code&gt;/&lt;code&gt;}&lt;/code&gt; blocks)&lt;/li&gt;
&lt;li&gt;Function definitions&lt;/li&gt;
&lt;li&gt;Recursive &lt;code&gt;eval&lt;/code&gt; and &lt;code&gt;$( )&lt;/code&gt; highlighting&lt;/li&gt;
&lt;li&gt;Chroma functions&lt;/li&gt;
&lt;li&gt;Math-mode highlighting&lt;/li&gt;
&lt;li&gt;Zcalc highlighting&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Performance&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Post install try: &lt;code&gt;fast-theme -t z-shell&lt;/code&gt;. To enable: &lt;code&gt;fast-theme z-shell&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Manual
&lt;/h3&gt;

&lt;p&gt;Clone the Repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/z-shell/F-Sy-H ~/path/to/fsh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And add the following to your &lt;code&gt;zshrc&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/path/to/fsh/F-Sy-H.plugin.zsh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;a href="https://github.com/z-shell/zi"&gt;ZI&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Add the following to your &lt;code&gt;zshrc&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi light z-shell/F-Sy-H
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's an example of how to load the plugin together with a few other popular ones with the use of &lt;a href="https://z.digitalclouds.dev/docs/getting_started/overview/#turbo-mode-zsh--53"&gt;Turbo mode&lt;/a&gt;, i.e.: speeding up the Zsh startup by loading the plugin right after the first prompt, in background:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi &lt;span class="nb"&gt;wait &lt;/span&gt;lucid &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
 atinit&lt;span class="s2"&gt;"ZI[COMPINIT_OPTS]=-C; zicompinit; zicdreplay"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    z-shell/F-Sy-H &lt;span class="se"&gt;\&lt;/span&gt;
 blockf &lt;span class="se"&gt;\&lt;/span&gt;
    zsh-users/zsh-completions &lt;span class="se"&gt;\&lt;/span&gt;
 atload&lt;span class="s2"&gt;"!_zsh_autosuggest_start"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    zsh-users/zsh-autosuggestions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;




&lt;h3&gt;
  
  
  Themes
&lt;/h3&gt;

&lt;p&gt;Switch themes via &lt;code&gt;fast-theme {theme-name}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uOq5CL4j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/theme.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uOq5CL4j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/theme.png" alt="image1" width="747" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;fast-theme -t {theme-name}&lt;/code&gt; option to obtain the snippet above.&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;fast-theme -l&lt;/code&gt; to list available themes.&lt;/p&gt;




&lt;h3&gt;
  
  
  Variables
&lt;/h3&gt;

&lt;p&gt;Comparing to the project &lt;code&gt;zsh-users/zsh-syntax-highlighting&lt;/code&gt; (the upper line):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5yfB_rf0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/parameter.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5yfB_rf0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/parameter.png" alt="image could not be loaded" width="140" height="52"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QS5npF0r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/in_string.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QS5npF0r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/in_string.png" alt="image could not be loaded" width="370" height="52"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Brackets
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NCkHPigC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/brackets.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NCkHPigC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/brackets.gif" alt="image could not be loaded" width="660" height="82"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Conditions
&lt;/h3&gt;

&lt;p&gt;Comparing to the project &lt;code&gt;zsh-users/zsh-syntax-highlighting&lt;/code&gt; (the upper line):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d0ZsiYMu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/cplx_cond.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d0ZsiYMu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/cplx_cond.png" alt="image could not be loaded" width="250" height="52"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Strings
&lt;/h3&gt;

&lt;p&gt;Exact highlighting that recognizes quotings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kn9P2ceQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/ideal-string.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kn9P2ceQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/ideal-string.png" alt="image could not be loaded" width="880" height="41"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  here-strings
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LoaxJwfd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/herestring.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LoaxJwfd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/herestring.png" alt="image could not be loaded" width="600" height="33"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;exec&lt;/code&gt; descriptor-variables
&lt;/h3&gt;

&lt;p&gt;Comparing to the project &lt;code&gt;zsh-users/zsh-syntax-highlighting&lt;/code&gt; (the upper line):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R4uA-Pa_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/execfd_cmp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R4uA-Pa_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/execfd_cmp.png" alt="image could not be loaded" width="223" height="56"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  for-loops and alternate syntax (brace &lt;code&gt;{&lt;/code&gt;/&lt;code&gt;}&lt;/code&gt; blocks)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CFfU_8PK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/for-loop-cmp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CFfU_8PK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/for-loop-cmp.png" alt="image could not be loaded" width="460" height="63"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Function definitions
&lt;/h3&gt;

&lt;p&gt;Comparing to the project &lt;code&gt;zsh-users/zsh-syntax-highlighting&lt;/code&gt; (the upper 2 lines):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M8HBnuR2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/function.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M8HBnuR2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/function.png" alt="image could not be loaded" width="338" height="88"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Recursive &lt;code&gt;eval&lt;/code&gt; and &lt;code&gt;$( )&lt;/code&gt; highlighting
&lt;/h3&gt;

&lt;p&gt;Comparing to the project &lt;code&gt;zsh-users/zsh-syntax-highlighting&lt;/code&gt; (the upper line):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X30dkDVF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/eval_cmp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X30dkDVF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/eval_cmp.png" alt="image could not be loaded" width="518" height="49"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Chroma functions
&lt;/h3&gt;

&lt;p&gt;Highlighting that is specific for a given command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pp2Z4gDR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/git_chroma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pp2Z4gDR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/git_chroma.png" width="880" height="44"&gt;&lt;/a&gt;
    alt="image could not be loaded"&lt;br&gt;
    style="color:red;background-color:black;font-weight:bold" /&amp;gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/z-shell/F-Sy-H/tree/main/chroma"&gt;chromas&lt;/a&gt;&lt;br&gt;
that are enabled by default can be found&lt;br&gt;
&lt;a href="https://github.com/z-shell/F-Sy-H/blob/main/fast-highlight#L166"&gt;here&lt;/a&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Math-mode highlighting
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fLZzm1Vm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/math.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fLZzm1Vm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/math.gif" alt="image could not be loaded" width="660" height="82"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Zcalc highlighting
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TOs22JO0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/zcalc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TOs22JO0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/z-shell/F-Sy-H/raw/main/docs/images/zcalc.png" alt="image could not be loaded" width="508" height="51"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Performance
&lt;/h2&gt;

&lt;p&gt;Performance differences can be observed in this Asciinema recording, where a &lt;code&gt;10 kB&lt;/code&gt; function is being edited.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://asciinema.org/a/112367"&gt;&lt;br&gt;
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1nt2_823--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://asciinema.org/a/112367.png" alt="asciicast" width="880" height="449"&gt;&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

</description>
      <category>zsh</category>
      <category>tooling</category>
      <category>hacktoberfest</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>⚙️ ❮ Zsh-Py3-HTTP ❯ | Auto Spawned service</title>
      <dc:creator>❮ ZI ❯</dc:creator>
      <pubDate>Sun, 27 Mar 2022 22:16:33 +0000</pubDate>
      <link>https://dev.to/z-shell/zsh-py3-http-auto-spawned-service-lfo</link>
      <guid>https://dev.to/z-shell/zsh-py3-http-auto-spawned-service-lfo</guid>
      <description>&lt;h2&gt;
  &lt;a href="https://github.com/z-shell/zi"&gt;
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MzzdUg8g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/z-shell/zi/main/docs/images/logo.png" alt="Logo" width="128" height="128"&gt;&lt;img&gt;&lt;/a&gt;

❮ ZI ❯ Service - Py3HTTP
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://z.digitalclouds.dev"&gt;https://z.digitalclouds.dev&lt;/a&gt; | &lt;a href="https://github.com/z-shell"&gt;GitHub&lt;/a&gt; | &lt;a href="https://twitter.com/zshell_zi"&gt;Twitter&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;This &lt;strong&gt;Zsh&lt;/strong&gt; service-plugin will serve given directory &lt;em&gt;(plugin's directory by default)&lt;/em&gt; using &lt;strong&gt;Python's 3 HTTP server&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Install with ❮ &lt;a href="https://github.com/z-shell/zi/"&gt;ZI&lt;/a&gt; ❯
&lt;/h3&gt;

&lt;p&gt;The service-plugin supports loading single plugin instance per all active Zsh sessions, in background.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zi ice service&lt;span class="s1"&gt;'py3http'&lt;/span&gt;
zi light z-shell/zservice-py3http
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Explanation of Zsh-spawned services
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;First Zsh instance that will gain a lock will spawn the service.&lt;/li&gt;
&lt;li&gt;Other Zsh instances will wait.&lt;/li&gt;
&lt;li&gt;When you close the initial Zsh session, another Zsh will gain lock and resume the service.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>zsh</category>
      <category>hacktoberfest</category>
      <category>contributorswanted</category>
      <category>python</category>
    </item>
    <item>
      <title>⚙️ ❮ Gems &amp; Node Modules With ZI ❯</title>
      <dc:creator>❮ ZI ❯</dc:creator>
      <pubDate>Sun, 27 Mar 2022 22:07:30 +0000</pubDate>
      <link>https://dev.to/z-shell/gems-node-modules-with-zi-4n64</link>
      <guid>https://dev.to/z-shell/gems-node-modules-with-zi-4n64</guid>
      <description>&lt;br&gt;
  &lt;a href="https://github.com/z-shell/zi"&gt;&lt;br&gt;
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MzzdUg8g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/z-shell/zi/main/docs/images/logo.png" alt="Logo" width="128" height="128"&gt;&lt;img&gt;&lt;/a&gt;

&lt;p&gt;&lt;a href="https://z.digitalclouds.dev"&gt;https://z.digitalclouds.dev&lt;/a&gt; | &lt;a href="https://github.com/z-shell"&gt;GitHub&lt;/a&gt; | &lt;a href="https://twitter.com/zshell_zi"&gt;Twitter&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;With use of the &lt;a href="https://github.com/z-shell/z-a-bin-gem-node"&gt;bin-gem-node&lt;/a&gt; annex you can install Ruby Gems and Node modules in an interesting way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;they'll be installed in the plugin's or snippet's directory,&lt;/li&gt;
&lt;li&gt;an automatic function will be provided to run the binary that's provided by the package.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This has several benefits. For example, no &lt;code&gt;$PATH&lt;/code&gt; alteration is required in the &lt;code&gt;.zprofile&lt;/code&gt; file. Also, the package will be automatically updated on &lt;code&gt;zi update&lt;/code&gt;. Plus, the installation will be isolated from other packages – multiple packages not be put in a single place.&lt;/p&gt;

&lt;p&gt;An example ZI invocation that installs the &lt;code&gt;remark&lt;/code&gt; tool that can be used to convert Markdown documents into man pages:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;zi ice &lt;span class="nb"&gt;wait&lt;/span&gt;&lt;span class="s1"&gt;'2'&lt;/span&gt; lucid id-as&lt;span class="s1"&gt;'remark'&lt;/span&gt; node&lt;span class="s1"&gt;'remark &amp;lt;- !remark-cli; remark-man'&lt;/span&gt;
zi snippet /dev/null
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;It is snippet-based. An example plugin-based invocation:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;zi ice &lt;span class="nb"&gt;wait&lt;/span&gt;&lt;span class="s1"&gt;'2'&lt;/span&gt; lucid id-as&lt;span class="s1"&gt;'remark'&lt;/span&gt; node&lt;span class="s1"&gt;'remark &amp;lt;- !remark-cli; remark-man'&lt;/span&gt;
zi load z-shell/null
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;It has an advantage – it will delete the &lt;code&gt;remark&lt;/code&gt; function when unloading the plugin.&lt;/p&gt;

&lt;p&gt;The exclamation-mark before &lt;code&gt;!remark-cli&lt;/code&gt; is important – it causes the automatic function invoking the binary to be created.&lt;/p&gt;

&lt;p&gt;More information can be found on the &lt;a href="https://github.com/z-shell/z-a-bin-gem-node"&gt;bin-gem-node annex page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The command installs 2 node modules – &lt;code&gt;remark-cli&lt;/code&gt; and &lt;code&gt;remark-man&lt;/code&gt; (the backend for the &lt;code&gt;remark&lt;/code&gt; converter – &lt;code&gt;remark&lt;/code&gt; can convert also to other formats).&lt;/p&gt;

&lt;p&gt;By using the exclamation-mark and the &lt;code&gt;&amp;lt;-&lt;/code&gt; pointer it also requests the function that will run the &lt;code&gt;remark&lt;/code&gt; binary to be created. The function has the following body:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;remark &lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;bindir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/root/.zi/plugins/remark/node_modules/.bin"&lt;/span&gt;
        &lt;span class="nb"&gt;local&lt;/span&gt; &lt;span class="nt"&gt;-x&lt;/span&gt; &lt;span class="nv"&gt;NODE_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/root/.zi/plugins/remark2"&lt;/span&gt;/node_modules
        &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$bindir&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;/&lt;span class="s2"&gt;"remark"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$@&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;As it can be seen it ultimately provides the &lt;code&gt;remark&lt;/code&gt; tool to the command line.&lt;/p&gt;

</description>
      <category>zsh</category>
      <category>gem</category>
      <category>node</category>
      <category>contributorswanted</category>
    </item>
  </channel>
</rss>
