X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=96869cc07a73ea7468c68353a22127778f621cc6;hb=a5eb2feca052396d5b923979118f68f626ac9d69;hp=c64a1f8c892995bb757a05934c43b97952137502;hpb=c0a2a4d13a0d0ca203f76da8fd2ed253ea74ee94;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index c64a1f8..96869cc 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -431,11 +431,22 @@ ZSH_NO_DEFAULT_LOCALE=${ZSH_NO_DEFAULT_LOCALE:-0} typeset -ga ls_options typeset -ga grep_options + +# Colors on GNU ls(1) if ls --color=auto / >/dev/null 2>&1; then ls_options+=( --color=auto ) +# Colors on FreeBSD and OSX ls(1) elif ls -G / >/dev/null 2>&1; then ls_options+=( -G ) fi + +# Natural sorting order on GNU ls(1) +# OSX and IllumOS have a -v option that is not natural sorting +if ls --version |& grep -q 'GNU' >/dev/null 2>&1 && ls -v / >/dev/null 2>&1; then + ls_options+=( -v ) +fi + +# Color on GNU and FreeBSD grep(1) if grep --color=auto -q "a" <<< "a" >/dev/null 2>&1; then grep_options+=( --color=auto ) fi @@ -1583,8 +1594,8 @@ function command_not_found_handler () { #v# HISTFILE=${HISTFILE:-${ZDOTDIR:-${HOME}}/.zsh_history} -isgrmlcd && HISTSIZE=500 || HISTSIZE=${HISTSIZE:-5000} -isgrmlcd && SAVEHIST=1000 || SAVEHIST=${SAVEHIST:-10000} # useful for setopt append_history +isgrmlcd && HISTSIZE=500 || HISTSIZE=5000 +isgrmlcd && SAVEHIST=1000 || SAVEHIST=10000 # useful for setopt append_history # dirstack handling @@ -2691,22 +2702,24 @@ Enjoy your grml system with the zsh!$reset_color" # debian stuff if [[ -r /etc/debian_version ]] ; then if [[ -z "$GRML_NO_APT_ALIASES" ]]; then - #a3# Execute \kbd{apt-cache search} - alias acs='apt-cache search' - #a3# Execute \kbd{apt-cache show} - alias acsh='apt-cache show' #a3# Execute \kbd{apt-cache policy} alias acp='apt-cache policy' if check_com -c apt ; then + #a3# Execute \kbd{apt search} + alias acs='apt search' + #a3# Execute \kbd{apt show} + alias acsh='apt show' #a3# Execute \kbd{apt dist-upgrade} salias adg="apt dist-upgrade" #a3# Execute \kbd{apt upgrade} salias ag="apt upgrade" #a3# Execute \kbd{apt install} salias agi="apt install" - #a3# Execute \kbd{apt-get update} + #a3# Execute \kbd{apt update} salias au="apt update" else + alias acs='apt-cache search' + alias acsh='apt-cache show' salias adg="apt-get dist-upgrade" salias ag="apt-get upgrade" salias agi="apt-get install"