Skip to content

Commit ccc03b9

Browse files
committed
Add Configure cd To Behave Like pushd In Zsh as a unix til
1 parent dc7cd17 commit ccc03b9

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
1010
For a steady stream of TILs from a variety of rocketeers, checkout
1111
[til.hashrocket.com](https://til.hashrocket.com/).
1212

13-
_755 TILs and counting..._
13+
_756 TILs and counting..._
1414

1515
---
1616

@@ -671,6 +671,7 @@ _755 TILs and counting..._
671671
- [Check The Current Working Directory](unix/check-the-current-working-directory.md)
672672
- [Clear The Screen](unix/clear-the-screen.md)
673673
- [Command Line Length Limitations](unix/command-line-length-limitations.md)
674+
- [Configure cd To Behave Like pushd In Zsh](unix/configure-cd-to-behave-like-pushd-in-zsh.md)
674675
- [Copying File Contents To System Paste Buffer](unix/copying-file-contents-to-system-paste-buffer.md)
675676
- [Create A File Descriptor with Process Substitution](unix/create-a-file-descriptor-with-process-substitution.md)
676677
- [Curling For Headers](unix/curling-for-headers.md)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Configure cd To Behave Like pushd In Zsh
2+
3+
The Zsh environment has a setting that allows you to make the `cd` command
4+
behave like the `pushd` command. Normally when you use `cd` the [remembered
5+
directory stack](list-the-stack-of-remembered-directories.md) is not
6+
effected. However, if you add the following setting to your `~/.zshrc` file:
7+
8+
```bash
9+
setopt auto_pushd
10+
```
11+
12+
then using `cd` to navigate directories will cause those directories to be
13+
added to the `dirs` stack.
14+
15+
This is the default in the [oh-my-zsh configuration of
16+
zsh](https://github.com/robbyrussell/oh-my-zsh/blob/master/lib/directories.zsh#L2).

0 commit comments

Comments
 (0)