From 6fdccd20b05ed18f01c019845e4e8578faf3350c Mon Sep 17 00:00:00 2001 From: Tercio Gaudencio Filho Date: Mon, 15 Oct 2018 09:56:41 -0300 Subject: [PATCH] Fix issue #1635. Option to disable GNU ls to group directories first. --- modules/utility/README.md | 6 ++++++ modules/utility/init.zsh | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/utility/README.md b/modules/utility/README.md index 9ace1eb..3b25b3a 100644 --- a/modules/utility/README.md +++ b/modules/utility/README.md @@ -18,6 +18,12 @@ disabled, type indicators (\*, /, =>, @, =, |, %) will be appended to entries. zstyle ':prezto:module:utility:ls' color 'no' ``` +To disable GNU coreutils `ls` to list directories grouped first, add the following line to *zpreztorc*: + +```sh +zstyle ':prezto:module:utility:ls' dirs-first 'no' +``` + To disable `diff` highlighting, add the following line to *zpreztorc*: ```sh diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index 942090d..6b07bf0 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -73,7 +73,10 @@ fi # ls if is-callable 'dircolors'; then # GNU Core Utilities - alias ls='ls --group-directories-first' + + if zstyle -T ':prezto:module:utility:ls' dirs-first; then + alias ls="${aliases[ls]:-ls} --group-directories-first" + fi if zstyle -t ':prezto:module:utility:ls' color; then # Call dircolors to define colors if they're missing