diff --git a/README.md b/README.md index 35246d7..98e9686 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_755 TILs and counting..._ +_756 TILs and counting..._ --- @@ -671,6 +671,7 @@ _755 TILs and counting..._ - [Check The Current Working Directory](unix/check-the-current-working-directory.md) - [Clear The Screen](unix/clear-the-screen.md) - [Command Line Length Limitations](unix/command-line-length-limitations.md) +- [Configure cd To Behave Like pushd In Zsh](unix/configure-cd-to-behave-like-pushd-in-zsh.md) - [Copying File Contents To System Paste Buffer](unix/copying-file-contents-to-system-paste-buffer.md) - [Create A File Descriptor with Process Substitution](unix/create-a-file-descriptor-with-process-substitution.md) - [Curling For Headers](unix/curling-for-headers.md) diff --git a/unix/configure-cd-to-behave-like-pushd-in-zsh.md b/unix/configure-cd-to-behave-like-pushd-in-zsh.md new file mode 100644 index 0000000..64f3ced --- /dev/null +++ b/unix/configure-cd-to-behave-like-pushd-in-zsh.md @@ -0,0 +1,16 @@ +# Configure cd To Behave Like pushd In Zsh + +The Zsh environment has a setting that allows you to make the `cd` command +behave like the `pushd` command. Normally when you use `cd` the [remembered +directory stack](list-the-stack-of-remembered-directories.md) is not +effected. However, if you add the following setting to your `~/.zshrc` file: + +```bash +setopt auto_pushd +``` + +then using `cd` to navigate directories will cause those directories to be +added to the `dirs` stack. + +This is the default in the [oh-my-zsh configuration of +zsh](https://github.com/robbyrussell/oh-my-zsh/blob/master/lib/directories.zsh#L2).