zshrc: simplify ls alias setup; remove -F from ls aliases
authorMoviuro <moviuro+grml@gmail.com>
Sun, 12 Apr 2015 12:16:32 +0000 (14:16 +0200)
committerMichael Prokop <mika@grml.org>
Mon, 13 Apr 2015 07:00:31 +0000 (09:00 +0200)
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

index f66bebc..d106274 100644 (file)
@@ -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'