From d388c0d2dfeb66a3d459b1481dd950ee6559d668 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 20 Jun 2020 19:01:50 +0800 Subject: zsh: Clean up _zshrc a bit --- _zshrc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/_zshrc b/_zshrc index f877b5a..ac5ad21 100644 --- a/_zshrc +++ b/_zshrc @@ -18,13 +18,16 @@ # OS checks # +IS_LINUX=false +IS_MAC=false +IS_BSD=false OS=$(uname -s) if [[ "${OS}" = 'Linux' ]]; then - IS_LINUX=1 + IS_LINUX=true elif [[ "${OS}" = 'Darwin' ]]; then - IS_MAC=1 + IS_MAC=true elif [[ "${OS}" = 'DragonFly' ]] || [[ "${OS}" =~ '.*BSD' ]]; then - IS_BSD=1 + IS_BSD=true fi # @@ -468,13 +471,13 @@ alias ..='cd ../' alias ...='cd ../../' alias ....='cd ../../../' alias cd..='cd ..' -alias d='dirs -v | head -10' +alias d='dirs -v | head -n 10' alias po=popd alias pu=pushd -if [[ -n "${IS_LINUX}" ]]; then +if ${IS_LINUX} ]]; then alias ls='ls --color=auto' -elif [[ -n "${IS_BSD}" ]] || [[ -n "${IS_MAC}" ]]; then +elif ${IS_BSD} || ${IS_MAC}; then alias ls='ls -G' fi alias l='ls -lah' @@ -497,7 +500,7 @@ exists "safe-rm" && alias rm=safe-rm # should go to `~/.profile'. # colors for BSD ls -if [[ -n "${IS_BSD}" ]]; then +if ${IS_BSD}; then export CLICOLOR=1 export LSCOLORS=exfxcxdxbxegedabagacad fi -- cgit v1.2.2