Reader small image

You're reading from  Learning Shell Scripting with Zsh

Product typeBook
Published inJan 2014
Publisher
ISBN-139781783282937
Edition1st Edition
Tools
Right arrow
Author (1)
Gaston Festari
Gaston Festari
author image
Gaston Festari

Gastón Festari is a scripting language enthusiast with over five years of experience and a firm believer in free, open source software. Currently working as a developer for Globant, he likes to spread the word about zsh at different meetups and events when away from the keyboard.
Read more about Gaston Festari

Right arrow

Getting started with completion


Nobody really likes to type boring filenames, and that's what got completion started back in the day—type a few letters of a filename, press Tab, and the shell will do the rest for you. Zsh goes the extra mile though and actually allows you to complete almost anything. By default, the Tab key is bound to a completion command in zsh.

Like Bash, zsh defaults to filename completion. Unlike anything else, however, zsh can enable the completion for practically everything that dares to rear its head in the command line—paths, external and built-in commands, aliases, functions, and options; you name it. And even if you can't name it, you can program it, as we will learn shortly.

Originally, zsh used a built-in module with a special syntax in order to provide completion. Luckily for us, this was eventually replaced by an even simpler mechanism. We'll focus on the new completion system that is entirely based on shell functions.

Go ahead and pop open that .zshrc file of...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Shell Scripting with Zsh
Published in: Jan 2014Publisher: ISBN-13: 9781783282937

Author (1)

author image
Gaston Festari

Gastón Festari is a scripting language enthusiast with over five years of experience and a firm believer in free, open source software. Currently working as a developer for Globant, he likes to spread the word about zsh at different meetups and events when away from the keyboard.
Read more about Gaston Festari