summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHazael Sanchez <hazaelsan@gmail.com>2023-02-02 02:30:34 -0800
committerGitHub <noreply@github.com>2023-02-02 11:30:34 +0100
commitea4854dba3ef72e18df2c7cc79db2806d92322eb (patch)
tree97f95e41f431b01ab73d108b6c06547563cf587f
parentb256c12d2e96d0fbe63910df82b9709cca4b38df (diff)
downloadzsh-ea4854dba3ef72e18df2c7cc79db2806d92322eb.tar.gz
zsh-ea4854dba3ef72e18df2c7cc79db2806d92322eb.tar.bz2
zsh-ea4854dba3ef72e18df2c7cc79db2806d92322eb.zip
feat(directories): add config to skip aliases (#11469)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
-rw-r--r--README.md10
-rw-r--r--lib/directories.zsh2
2 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md
index 1e4b7ff70..7f4a26cab 100644
--- a/README.md
+++ b/README.md
@@ -276,6 +276,16 @@ If you have many functions that go well together, you can put them as a `XYZ.plu
If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`.
+### Remove directories aliases
+
+If you want to skip ohmyzsh default
+[directories aliases](https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/directories.zsh) you can add the
+following snippet to your `zshrc`, before loading `oh-my-zsh.sh` script:
+
+```zsh
+zstyle ':omz:directories' aliases no
+```
+
## Getting Updates
By default, you will be prompted to check for updates every 2 weeks. You can choose other update modes by adding a line to your `~/.zshrc` file, **before Oh My Zsh is loaded**:
diff --git a/lib/directories.zsh b/lib/directories.zsh
index c62f56468..5aa1b3d5b 100644
--- a/lib/directories.zsh
+++ b/lib/directories.zsh
@@ -3,6 +3,8 @@ setopt auto_pushd
setopt pushd_ignore_dups
setopt pushdminus
+zstyle -T ':omz:directories' aliases || return
+
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'