Zsh Mode Help
Name:Zsh Mode
Version:0.1
Last update:2021-02-25 11:19:17





Introduction

Zsh Mode is a mode for the text editor Alpha: it installs basic support for editing script files for the Z Shell (aka zsh) using the Alpha text editor. This mode provides the following features: Click on this Zsh Example link for an example syntax file.

Editing in Zsh mode

There are several ways of editing a file in Zsh mode:

Completions

There are two aspects for word completion in Zsh mode: The flow control keywords recognized by the Zsh mode are: case, for, func, if, ifelif, ifelse, repeat, select, until, while.

File marking

You can mark two kinds of items using the Marks popup (📖):

Parse popup

In Zsh mode, the Parse popup (⚙) of document windows displays the function definitions found in the document. The zsh syntax provides two forms of function definition and Zsh mode recognizes both. For instance, you can write either
foo () {
	echo bar
}
or
function foo {
	echo bar
}

Key bindings

The following key bindings are defined in Zsh mode:

Script execution

The Ctrl-X key binding lets you execute the contents of the document window by sending it to the Mac OS X Terminal. The command takes care of launching the Terminal application if it is not already running. Zsh mode makes some preliminary checks before sending the script: it verifies that the execute flag is set, that the window has Unix line endings and that is has been saved.
Note that you can set the executable flag of a file manually in Alpha using the Info popup (🄸) located in the control bar of the document window. There is an item called Executable… which can be set on or off.

Known problems

Please report any problem or bug you encounter in Alpha's Bug Tracker.

License and Disclaimer

Copyright (c) 2020-2021, Bernard Desgraupes.
All rights reserved.
The Zsh Mode package is free software and distributed under the terms of the new BSD license:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BERNARD DESGRAUPES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.