Skip to content

Instantly share code, notes, and snippets.

@soifou
Last active August 8, 2021 12:57
Show Gist options
  • Save soifou/c99be4373f6ffe3b4ff7 to your computer and use it in GitHub Desktop.
Save soifou/c99be4373f6ffe3b4ff7 to your computer and use it in GitHub Desktop.

Revisions

  1. soifou revised this gist May 10, 2019. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions zsh-antigen-debian.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    # Quickly setup Zsh powered by antigen on fresh Debian servers
    # Usage: bash -c "$(curl -fsSL https://gist.github.com/soifou/c99be4373f6ffe3b4ff7/raw/COMMIT_ID/zsh-antigen-debian.sh)"
    ANTIGEN_VERSION=1.2.0


    if [[ $(which zsh | wc -m) == 0 ]]; then
    echo "Zsh is not installed... installing"
    @@ -16,7 +16,7 @@ fi
    if [[ ! -d $HOME/.antigen ]]; then
    echo "Clone antigen repository..."
    mkdir $HOME/.antigen
    curl https://cdn.rawgit.com/zsh-users/antigen/v$ANTIGEN_VERSION/bin/antigen.zsh > $HOME/.antigen/antigen.zsh
    curl -L git.io/antigen > $HOME/.antigen/antigen.zsh
    fi

    if [[ -f $HOME/.zshrc ]]; then
    @@ -35,7 +35,7 @@ antigen bundle git
    antigen bundle command-not-found
    antigen bundle zsh-users/zsh-syntax-highlighting
    antigen bundle zsh-users/zsh-history-substring-search
    antigen theme pure
    antigen theme bureau
    antigen apply
    bindkey '^[[A' history-substring-search-up
    bindkey '^[[B' history-substring-search-down
  2. soifou revised this gist Nov 24, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions zsh-antigen-debian.sh
    Original file line number Diff line number Diff line change
    @@ -34,8 +34,11 @@ antigen bundle debian
    antigen bundle git
    antigen bundle command-not-found
    antigen bundle zsh-users/zsh-syntax-highlighting
    antigen bundle zsh-users/zsh-history-substring-search
    antigen theme pure
    antigen apply
    bindkey '^[[A' history-substring-search-up
    bindkey '^[[B' history-substring-search-down
    EOF

    CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
  3. soifou revised this gist Oct 12, 2016. 1 changed file with 13 additions and 11 deletions.
    24 changes: 13 additions & 11 deletions zsh-antigen-debian.sh
    Original file line number Diff line number Diff line change
    @@ -2,19 +2,21 @@

    # Quickly setup Zsh powered by antigen on fresh Debian servers
    # Usage: bash -c "$(curl -fsSL https://gist.github.com/soifou/c99be4373f6ffe3b4ff7/raw/COMMIT_ID/zsh-antigen-debian.sh)"
    ANTIGEN_VERSION=1.2.0

    if [[ $(which zsh | wc -m) == 0 ]]; then
    echo "Zsh is not installed... installing"
    apt-get install -y zsh
    sudo apt-get install -y zsh
    fi
    if [[ $(which git | wc -m) == 0 ]]; then
    echo "Git is not installed... installing"
    apt-get install -y git
    if [[ $(which curl | wc -m) == 0 ]]; then
    echo "Curl is not installed... installing"
    sudo apt-get install -y curl
    fi

    if [[ ! -d $HOME/antigen ]]; then
    if [[ ! -d $HOME/.antigen ]]; then
    echo "Clone antigen repository..."
    git clone https://github.com/zsh-users/antigen.git $HOME/.antigen
    mkdir $HOME/.antigen
    curl https://cdn.rawgit.com/zsh-users/antigen/v$ANTIGEN_VERSION/bin/antigen.zsh > $HOME/.antigen/antigen.zsh
    fi

    if [[ -f $HOME/.zshrc ]]; then
    @@ -32,16 +34,16 @@ antigen bundle debian
    antigen bundle git
    antigen bundle command-not-found
    antigen bundle zsh-users/zsh-syntax-highlighting
    antigen theme bureau
    antigen theme pure
    antigen apply
    EOF

    TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
    if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
    CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
    if [ "$CURRENT_SHELL" != "zsh" ]; then
    echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
    chsh -s $(grep /zsh$ /etc/shells | tail -1)
    sudo chsh --shell=$(grep /zsh$ /etc/shells | tail -1) $USER
    fi
    unset TEST_CURRENT_SHELL
    unset CURRENT_SHELL

    echo "Reload shell..."
    env zsh
  4. soifou revised this gist May 1, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions zsh-antigen-debian.sh
    Original file line number Diff line number Diff line change
    @@ -5,11 +5,11 @@

    if [[ $(which zsh | wc -m) == 0 ]]; then
    echo "Zsh is not installed... installing"
    apt-get install zsh
    apt-get install -y zsh
    fi
    if [[ $(which git | wc -m) == 0 ]]; then
    echo "Git is not installed... installing"
    apt-get install git
    apt-get install -y git
    fi

    if [[ ! -d $HOME/antigen ]]; then
  5. soifou revised this gist May 1, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions zsh-antigen-debian.sh
    Original file line number Diff line number Diff line change
    @@ -5,11 +5,11 @@

    if [[ $(which zsh | wc -m) == 0 ]]; then
    echo "Zsh is not installed... installing"
    sudo apt-get install zsh
    apt-get install zsh
    fi
    if [[ $(which git | wc -m) == 0 ]]; then
    echo "Git is not installed... installing"
    sudo apt-get install git
    apt-get install git
    fi

    if [[ ! -d $HOME/antigen ]]; then
  6. soifou revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion zsh-antigen-debian.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/bin/bash

    # Quickly setup Zsh powered by antigen on fresh Debian servers
    # Usage: bash -c "$(curl -fsSL https://gist.github.com/soifou/c99be4373f6ffe3b4ff7/raw/cac9c2c0b5273d75c5bf5b5b5921c6579c0849a1/zsh-antigen-debian.sh)"
    # Usage: bash -c "$(curl -fsSL https://gist.github.com/soifou/c99be4373f6ffe3b4ff7/raw/COMMIT_ID/zsh-antigen-debian.sh)"

    if [[ $(which zsh | wc -m) == 0 ]]; then
    echo "Zsh is not installed... installing"
  7. soifou revised this gist Feb 14, 2016. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions zsh-antigen-debian.sh
    Original file line number Diff line number Diff line change
    @@ -24,9 +24,8 @@ fi

    echo "Configuring zshrc..."
    cat > "$HOME/.zshrc" <<EOF
    export LANGUAGE="UTF-8"
    export LC_ALL="UTF-8"
    export LANG="UTF-8"
    LC_CTYPE=en_US.UTF-8
    LC_ALL=en_US.UTF-8
    source $HOME/.antigen/antigen.zsh
    antigen use oh-my-zsh
    antigen bundle debian
  8. soifou revised this gist Feb 14, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions zsh-antigen-debian.sh
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ fi

    if [[ ! -d $HOME/antigen ]]; then
    echo "Clone antigen repository..."
    git clone https://github.com/zsh-users/antigen.git $HOME/antigen
    git clone https://github.com/zsh-users/antigen.git $HOME/.antigen
    fi

    if [[ -f $HOME/.zshrc ]]; then
    @@ -27,7 +27,7 @@ cat > "$HOME/.zshrc" <<EOF
    export LANGUAGE="UTF-8"
    export LC_ALL="UTF-8"
    export LANG="UTF-8"
    source $HOME/antigen/antigen.zsh
    source $HOME/.antigen/antigen.zsh
    antigen use oh-my-zsh
    antigen bundle debian
    antigen bundle git
  9. soifou revised this gist Feb 12, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion zsh-antigen-debian.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/bin/bash

    # Quickly setup Zsh powered by antigen on fresh Debian servers
    # Usage: bash -c "$(curl -fsSL https://raw.github.com/gist/id)"
    # Usage: bash -c "$(curl -fsSL https://gist.githubusercontent.com/soifou/c99be4373f6ffe3b4ff7/raw/cac9c2c0b5273d75c5bf5b5b5921c6579c0849a1/zsh-antigen-debian.sh)"

    if [[ $(which zsh | wc -m) == 0 ]]; then
    echo "Zsh is not installed... installing"
  10. soifou created this gist Feb 12, 2016.
    49 changes: 49 additions & 0 deletions zsh-antigen-debian.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    #!/bin/bash

    # Quickly setup Zsh powered by antigen on fresh Debian servers
    # Usage: bash -c "$(curl -fsSL https://raw.github.com/gist/id)"

    if [[ $(which zsh | wc -m) == 0 ]]; then
    echo "Zsh is not installed... installing"
    sudo apt-get install zsh
    fi
    if [[ $(which git | wc -m) == 0 ]]; then
    echo "Git is not installed... installing"
    sudo apt-get install git
    fi

    if [[ ! -d $HOME/antigen ]]; then
    echo "Clone antigen repository..."
    git clone https://github.com/zsh-users/antigen.git $HOME/antigen
    fi

    if [[ -f $HOME/.zshrc ]]; then
    echo "Found existing zshrc... backup"
    mv $HOME/.zshrc $HOME/.zshrc.dotbackup
    fi

    echo "Configuring zshrc..."
    cat > "$HOME/.zshrc" <<EOF
    export LANGUAGE="UTF-8"
    export LC_ALL="UTF-8"
    export LANG="UTF-8"
    source $HOME/antigen/antigen.zsh
    antigen use oh-my-zsh
    antigen bundle debian
    antigen bundle git
    antigen bundle command-not-found
    antigen bundle zsh-users/zsh-syntax-highlighting
    antigen theme bureau
    antigen apply
    EOF

    TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
    if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
    echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
    chsh -s $(grep /zsh$ /etc/shells | tail -1)
    fi
    unset TEST_CURRENT_SHELL

    echo "Reload shell..."
    env zsh
    source $HOME/.zshrc