DEV Community

Cover image for Finally Got The Autocomplete
Jessica Woudsma
Jessica Woudsma

Posted on

Finally Got The Autocomplete

In my post-bootcamp haze, it registered in my brain that zsh came on the stage as the default shell for Apple(1). My MacBook Air, in all of it's glory, had been giving me such a confidence boost every time I was in the Terminal.

"cd and ls- that's the safest thing I can do in the Terminal and still feel kind of like I might appear to know what I am doing" and I could look for my files in what felt to be an organizational structure at the time.

But that tab key. It would autofill! Save me from unneeded typing! And soul-crushing mistakes! I hit quite a mistake high score with my React solo project, doing things like getting my props and state mixed up because I couldn't begin to tell you what the difference was(2).

Once I came to, and started to create projects again, I realized the autocomplete was no longer. Luckily, I did not run the "you are a terrible, horrible, no good very bad developer"(3) speech like I have in the past, but instead, I just figured "well I will benefit from typing things out and paying attention to detail."

Which is a noble way of being lazy in solving a problem, I suppose.

But today, TODAY, it was the day. Autocomplete.

After a few googles, and a few "omg what if this is fake code and it will give me eternal blue screen of death", I decided that 1) I will have zsh, not bash, as my default, since it is an option, and 2) to use the following two lines:

echo 'autoload -Uz compinit && compinit' >> ~/.zshrc
source ~/.zshrc

A quick restart of my shell, and oooh boy, look who is tabbing all over the Terminal?!

Yep. It's me.

And now it can be you, too, if you have also been silly this whole time. And have a Mac. And would like zsh to be your default shell.

(1) macOS 10.15 Catalina release in on June 3, 2019

(2) Kent C Dodd puts it well in the following: "What's the difference between props and state in React? ... 'props' (short for 'properties') is an object of arbitrary inputs a React function component accepts as the first argument. 'state' is data that changes over the lifetime of a specific instance of a React component."


Discussion (0)