Configuration options

Previous: Part 1 — Setup

Image for post
Image for post
Photo by Kimon Maritz on Unsplash

In part one we did some basic setup to get the history mechanism working in Zsh. In this article we will explore a few options to customize the Zsh environment using setopt in the .zshrc. The full list of options can be found in the documentation.

Persistence

Default behavior is to overwrite the existing history file upon shell exit. The following are all methods of appending rather than rewriting the file — taking advantage of that potentially massive history size we set up in part one.

  • APPEND_HISTORY
  • INC_APPEND_HISTORY
  • SHARE_HISTORY

The difference being that APPEND_HISTORY appends lines in the order in which each session is closed while INC_APPEND_HISTORY adds lines to the history in the order in which they are executed. SHARE_HISTORY is the equivalent of INC_APPEND_HISTORY but also imports new commands, allowing lines to be shared across multiple open sessions. …


Configuration setup

Next: Part 2 — Options

Image for post
Image for post
Photo by Timothy Newman on Unsplash

I recently combed through the dot (hidden) files in my mac’s home directory and was shocked to see just how polluted it had become. Now I know that there is no real downside to leaving these files where they were, but as I prefer to keep my development environment nice and tidy, I took the opportunity to take a closer look into some configurations that I had ignored up to this point.

Zsh config files

If you are unfamiliar with the types of zsh configuration files and their uses, I recommend looking through this article in a great series over at scriptingosx.com. For this example we will keep everything in the .zshrc file. If one doesn’t already exist in your home folder, in the terminal run touch .zshrc

Ryan Todd Garza

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store