ela
Contents

ManualShell

Tab completion

In the terminalela --spec tab-completion

Tab completes the word before the cursor; what it offers depends on where the word stands:

WhereCandidates
A command's first wordcommands on PATH, aliases, the shell built-ins, procs and built-in procs (with their (), packages and imports (with their .)
A command's argument, a word a for loops over (for f in *.md), or a word with a / or starting with ~file and directory names; a directory ends in /, and a name starting with a dot is offered only when the word starts with one
Inside a string left openfile and directory names, for the string's whole text
$namethe variables and constants in scope
$env.NAMEthe environment's variables
package.name or import.namethat package's or import's procs
Inside an expressionprocs, built-in procs, packages and imports; where a call's argument starts, after its ( or a comma, the call's parameter names too, as name = (none for a variadic one)
Inside a commentnothing

A file or directory name goes in as one word, the way ela reads it. A name holding a space, a quote, a control character or a character ela reads on its own ($ * ? | ; < > & # ( ) [ ] { } , = \), or starting with ~, goes in single quotes: cat My⇥ gives cat 'My Notes.txt'. A name holding a single quote goes in double quotes, with \, " and $ escaped. A leading ~/ stays outside the quotes, so it still names the home folder. Inside a string left open, Tab completes within it, in its own quotes, or in double quotes when the name holds a single quote. A file's quotes are closed; a directory's are left open, so the next Tab goes on inside it. Any other name goes in as it is.