Powerful scripting language & versatile interactive shell add sylixos support.
Go to file
2016-02-22 23:28:28 +01:00
edit Put writer log under a flag. 2016-02-22 23:10:25 +01:00
eval Add logging; don't relay signal from stub after seeing EOF. 2016-02-22 23:06:00 +01:00
glob Fix ~/* in a pretty hacky way. 2016-02-22 16:05:14 +01:00
parse Allow newlines in more spaces. 2016-02-22 13:44:56 +01:00
run Synchronize logSignals and handleHupAndQuit. 2016-02-22 15:24:38 +01:00
store Go back to mattn/go-sqlite3. 2016-02-20 03:04:44 +01:00
stub Add logging; don't relay signal from stub after seeing EOF. 2016-02-22 23:06:00 +01:00
stubimpl Update working directory of elvish-stub. 2016-02-22 18:42:25 +01:00
sys sys: Fix error reporting of Tcsetgrp. 2016-02-21 16:20:01 +01:00
util Move functionality of edit/search.go to util. 2016-02-21 14:32:13 +01:00
.gitattributes Use .gitattributes to filter go sources through goimports 2014-02-10 12:41:16 +08:00
.gitignore In Makefile, shorten coverage to cover 2014-09-24 23:56:12 +02:00
.travis.yml Give up the attempt of using Travis to upload artifacts. 2016-02-09 23:54:28 +01:00
CONTRIBUTING.md Move the "contributing" section to a shiny CONTRIBUTING.md file 2016-02-19 00:13:35 +01:00
Dockerfile update Dockerfile 2016-02-09 16:43:58 +08:00
LICENSE Project rename: das -> elvish 2014-01-29 18:44:07 +08:00
main.go Put the actual entry function in a new run package. 2016-02-21 12:52:47 +01:00
Makefile Add a phony target "stub". 2016-02-22 14:49:21 +01:00
README.md Update README. 2016-02-22 23:28:28 +01:00

A novel Unix shell

GoDoc Build Status on Travis

This project aims to explore the potentials of the Unix shell. It is a work in progress; things will change without warning.

The wiki has a random list of things you might want to know. The issues list contains many things I'm working on.

The Interface

Syntax highlighting (also showcasing right-hand-side prompt):

syntax highlighting

Tab completion for files:

tab completion

Navigation mode (triggered with ^N, inspired by ranger):

navigation mode

Planned features:

  • Auto-suggestion (like fish)
  • Programmable line editor
  • Directory jumping (#27)
  • A vi keybinding that makes sense
  • History listing (like ptpython)
  • Intuitive multiline editing

The Language

Some things that the language is already capable of:

  • External programs and pipelines: (~> is the prompt):

    ~> vim README.md
    ...
    ~> cat -v /dev/random
    ...
    ~> dmesg | grep -i acpi
    ...
    
  • Arithmetics using the prefix notation:

    ~> + 1 2
    ▶ 3
    ~> mul (+ 1 2) 3
    ▶ 9
    
  • Quoting:

    ~> echo "|  Ceci n'est pas une pipe."
    |  Ceci n'est pas une pipe.
    
  • Lists and maps:

    ~> println list: [a list] map: [&key=value]
    list: [a list] map: [&key=value]
    ~> println [a b c][0]
    a
    ~> println [&key=value][key]
    value
    
  • Variables:

    ~> v=[&foo=bar]; put $v[foo]
    ▶ bar
    
  • Defining functions:

    ~> fn map [f xs]{ put [(put $@xs | each $f)] }
    
  • Lisp-like functional programming:

    ~> map [x]{+ 10 $x} [1 2 3]
    [11 12 13]
    ~> map [x]{div $x 2} (map [x]{+ 10 $x} [1 2 3])
    [5.5 6 6.5]
    
  • More natural concatenative style:

    ~> put 1 2 3 | each [x]{+ 10 $x} | each [x]{div $x 2}
    ▶ 5.5
    ▶ 6
    ▶ 6.5
    
  • A separate env: namespace for environmental variables:

    ~> put $env:HOME
    ▶ /home/xiaq
    ~> env:PATH=$env:PATH":/bin"
    

Getting elvish

Prebuilt binaries

Prebuilt binaries are available for 64-bit Linux and Mac OS X. They are always built using the latest commit that builds. Download the archive and use sudo tar xfJ elvish-*.tar.xz -C /usr/bin to install.

Building It Yourself

Go >= 1.5 is required. Linux is fully supported. It is likely to work on BSDs and Mac OS X. Windows is not supported yet.

The main binary can be installed using go get github.com/elves/elvish. There is also an auxiliary program called elvish-stub; install it with make stub. Elvish is funtional without the stub, but job control features depend on it.

If you are lazy and use bash for zsh now, here is something you can copy-paste into your terminal:

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
mkdir -p $GOPATH

go get github.com/elves/elvish
make -C $GOPATH/src/github.com/elves/elvish stub

for f in ~/.bashrc ~/.zshrc; do
    echo -e 'export GOPATH=$HOME/go\nexport PATH=$PATH:$GOPATH/bin' >> $f
done

How To Write Go Code explains how $GOPATH works.

Name

In roguelikes, items made by the elves have a reputation of high quality. These are usually called elven items, but I chose elvish for an obvious reason.

The adjective for elvish is also "elvish", not "elvishy" and definitely not "elvishish".

Test coverages:

Package Coverage
edit edit
eval eval
glob glob
parse parse
run run
store store
stub stub
sys sys
util util