From dbadcc3b6c54fdaf2eb044c7f6aec205fda639ea Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Tue, 4 Apr 2023 14:15:59 +0300 Subject: [PATCH] zsh: enable colors in listings, enable gcloud --- config/exports | 19 ++++++++++++++----- config/functions | 1 + 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/config/exports b/config/exports index dd4ab7e..7ee799e 100755 --- a/config/exports +++ b/config/exports @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # shellcheck shell=bash # Explicitly set XDG folders @@ -35,6 +36,13 @@ hash shopt 2> /dev/null && shopt -s checkwinsize export LC_ALL=fi_FI.utf8 +# If we are using zsh, color our dir lists and such +if [ $SHELL = $(which zsh) ]; then + LS_COLORS='no=00;37:fi=00:di=00;33:ln=04;36:pi=40;33:so=01;35:bd=40;33;01:' + export LS_COLORS + zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} +fi + # Antigen configuration # https://github.com/zsh-users/antigen/wiki/Configuration export ADOTDIR="$XDG_DATA_HOME/antigen" @@ -131,13 +139,14 @@ if hash ansible 2> /dev/null; then fi # gcloud is present -#if hash gcloud 2>/dev/null; then -# GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet) -# [[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc" -# [[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc" -#fi +if hash gcloud 2>/dev/null; then + GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet) + [[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc" + [[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc" +fi # Load iterm2 shell integration # https://iterm2.com/documentation-shell-integration.html [[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] \ && source "$XDG_BIN_HOME/iterm2_shell_integration.zsh" + diff --git a/config/functions b/config/functions index 355797a..8041a75 100755 --- a/config/functions +++ b/config/functions @@ -91,3 +91,4 @@ function x-default-antigen-bundles hash python 2> /dev/null && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv hash rvm 2> /dev/null && antigen bundle unixorn/rvm-plugin } +