From 2065da59e373daa1747b580b0a48dce8b075a0d6 Mon Sep 17 00:00:00 2001 From: Moviuro Date: Sun, 12 Apr 2015 14:16:32 +0200 Subject: [PATCH] zshrc: simplify ls alias setup; remove -F from ls aliases To add `-F` to your aliases, use the following in .zshrc.pre: typeset -ga ls_options ls_options=( -F ) (cherry picked from commit 189949c6aa3a0d140a10d8e1c3914887bd4c0057) NOTE from Michael Prokop (merging the PR to the Grml git repository): This unifies the behaviour of ls output, we should either use '-F' everywhere or not at all in our provided ls related aliases. Thanks to Christian Hesse for triggering this via PR #32 --- etc/zsh/zshrc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index f66bebc..d106274 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -2442,17 +2442,16 @@ fi # do we have GNU ls with color-support? if [[ "$TERM" != dumb ]]; then #a1# List files with colors (\kbd{ls -F \ldots}) - alias ls='command ls -F '${ls_options:+"${ls_options[*]}"} + alias ls="command ls ${ls_options:+${ls_options[*]}}" #a1# List all files, with colors (\kbd{ls -la \ldots}) - alias la='command ls -la '${ls_options:+"${ls_options[*]}"} + alias la="command ls -la ${ls_options:+${ls_options[*]}}" #a1# List files with long colored list, without dotfiles (\kbd{ls -l \ldots}) - alias ll='command ls -l '${ls_options:+"${ls_options[*]}"} + alias ll="command ls -l ${ls_options:+${ls_options[*]}}" #a1# List files with long colored list, human readable sizes (\kbd{ls -hAl \ldots}) - alias lh='command ls -hAl '${ls_options:+"${ls_options[*]}"} + alias lh="command ls -hAl ${ls_options:+${ls_options[*]}}" #a1# List files with long colored list, append qualifier to filenames (\kbd{ls -lF \ldots})\\&\quad(\kbd{/} for directories, \kbd{@} for symlinks ...) - alias l='command ls -lF '${ls_options:+"${ls_options[*]}"} + alias l="command ls -l ${ls_options:+${ls_options[*]}}" else - alias ls='command ls -F' alias la='command ls -la' alias ll='command ls -l' alias lh='command ls -hAl' -- 2.1.4