zshrc: Enable ls(1)'s natural sorting if available
authorMoviuro <moviuro+grml@gmail.com>
Thu, 14 Jan 2016 20:56:50 +0000 (21:56 +0100)
committerMoviuro <moviuro+grml@gmail.com>
Thu, 14 Jan 2016 20:56:50 +0000 (21:56 +0100)
etc/zsh/zshrc

index c021c87..451b5dd 100644 (file)
@@ -436,6 +436,12 @@ if ls --color=auto / >/dev/null 2>&1; then
 elif ls -G / >/dev/null 2>&1; then
     ls_options+=( -G )
 fi
+
+# Natural sorting order on GNU ls(1)
+if ls -v / >/dev/null 2>&1; then
+    ls_options+=( -v )
+fi
+
 if grep --color=auto -q "a" <<< "a" >/dev/null 2>&1; then
     grep_options+=( --color=auto )
 fi