From ae92f6ec8bef5a9274a33727aea82a78b632f0f0 Mon Sep 17 00:00:00 2001
From: abizer <abizer@abizer.me>
Date: Tue, 17 Oct 2023 18:49:21 -0700
Subject: [PATCH] add zstyle to disable alias sl=ls

sl is the command alias for [`sapling`](https://github.com/facebook/sapling)
so this alias conflicts with it. Add an option to disable the alias.
---
 modules/utility/README.md | 9 +++++++++
 modules/utility/init.zsh  | 5 ++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/modules/utility/README.md b/modules/utility/README.md
index 142b1eae..00a0fdfa 100644
--- a/modules/utility/README.md
+++ b/modules/utility/README.md
@@ -142,6 +142,15 @@ zstyle ':prezto:module:utility' correct 'no'
 - `lu` lists sorted by date, most recent last, shows access time.
 - `sl` lists directory contents (correction for `ls`).
 
+To disable the correction of `sl` to `ls`, which conflicts with
+[sapling](https://github.com/facebook/sapling), add the following to
+_`${ZDOTDIR:-$HOME}/.zpreztorc`_:
+
+```sh
+zstyle ':prezto:module:utility' slls 'no'
+```
+
+
 ### macOS Everywhere
 
 - `o` opens files and directories (`open` or `xdg-open`).
diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh
index 7e2e14ed..a48afe16 100644
--- a/modules/utility/init.zsh
+++ b/modules/utility/init.zsh
@@ -122,7 +122,10 @@ alias lk='ll -Sr'        # Lists sorted by size, largest last.
 alias lt='ll -tr'        # Lists sorted by date, most recent last.
 alias lc='lt -c'         # Lists sorted by date, most recent last, shows change time.
 alias lu='lt -u'         # Lists sorted by date, most recent last, shows access time.
-alias sl='ls'            # Correction for common spelling error.
+
+if zstyle -T ':prezto:module:utility' slls; then
+    alias sl='ls'            # Correction for common spelling error.
+fi
 
 if [[ ${(@M)${(f)"$(ls --version 2>&1)"}:#*GNU *} ]]; then
   alias lx='ll -XB'      # Lists sorted by extension (GNU only).