Skip to content
Bash/Zsh completion scripts for Elm binary and tools
Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE initial commit with elm, elm-test Aug 5, 2019
README.md add some notes and tests about elm command not found Aug 15, 2019
elm-completion.sh add some notes and tests about elm command not found Aug 15, 2019

README.md

Bash/Zsh completion script for Elm binary and tools

Supported tools

Install

To install, there are two options:

  • using /etc/bash_completion.d
  • using .bashrc

Whatever the method, be sure that the script is sourced after potential $PATH settings that allow to find the elm command as the completion script needs to be able to run elm --version.

It might be easier using .bashrc if you install elm using npm.

1. Add the file in /etc/bash_completion.d/ if it exists on your system:

sudo curl -o /etc/bash_completion.d/elm https://raw.githubusercontent.com/dmy/elm-sh-completion/master/elm-completion.sh

2. Source the file from your ~/.bashrc

For example:

mkdir -p ~/.bash
cd ~/.bash
git clone https://github.com/dmy/elm-sh-completion.git
echo 'source ~/.bash/elm-sh-completion/elm-completion.sh' >> ~/.bashrc

Notes

  • Packages are also matched from partial match, so you can complete packages by using the package name or part of it, for example:
elm ins[TAB]
elm install regex[TAB]
elm install elm/regex

If there are several matches, the common prefix of all matches will be completed.

  • Packages are auto-completed from the local cache for efficiency, so packages that have never been installed are not completed.
  • Zsh completion uses bashcompinit.
  • Cygwin is theorically supported, but this has not been tested yet.
  • elm-json comes with its own auto-generated completion scripts for bash, zsh and fish.
    See elm-json completions --help.
You can’t perform that action at this time.