Skip to content

Instantly share code, notes, and snippets.

@andrey-zh
Last active April 13, 2022 13:05
Show Gist options
  • Save andrey-zh/d11f99db2c1a62b0fd672da350ae90c2 to your computer and use it in GitHub Desktop.
Save andrey-zh/d11f99db2c1a62b0fd672da350ae90c2 to your computer and use it in GitHub Desktop.

Revisions

  1. andrey-zh revised this gist Apr 13, 2022. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -43,10 +43,10 @@ sudo hostname acloudguru
    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
    unzip awscliv2.zip
    sudo ./aws/install
    #echo "autoload bashcompinit && bashcompinit
    #autoload -Uz compinit && compinit" >> ~/.zshrc
    #echo "complete -C '/usr/local/bin/aws_completer' aws" >> ~/.zshrc
    #source ~/.zshrc
    echo "autoload bashcompinit && bashcompinit
    autoload -Uz compinit && compinit" >> ~/.zshrc
    echo "complete -C '/usr/local/bin/aws_completer' aws" >> ~/.zshrc


    brew tap hashicorp/tap
    brew install hashicorp/tap/terraform
  2. andrey-zh revised this gist Apr 13, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ sudo apt-get install build-essential -y

    ##### install zsh #####
    sudo apt-get install zsh -y
    sudo yum install util-linux-user -y
    sudo apt-get install -y util-linux -y
    chsh -s $(which zsh)
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

  3. andrey-zh revised this gist Apr 13, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,7 @@ sudo apt-get install build-essential -y

    ##### install zsh #####
    sudo apt-get install zsh -y
    sudo yum install util-linux-user -y
    chsh -s $(which zsh)
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

  4. andrey-zh revised this gist Apr 8, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    #!/bin/bash

    ##### install updates #####
    sudo apt-get update
    sudo apt-get install build-essential -y
  5. andrey-zh revised this gist Apr 8, 2022. 1 changed file with 45 additions and 11 deletions.
    56 changes: 45 additions & 11 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,8 @@ curl -sS https://webinstall.dev/vim-prettier | bash
    curl -sS https://webinstall.dev/vim-ale | bash
    curl -sS https://webinstall.dev/vim-lastplace | bash

    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/cloud_user/.profile
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> $HOME/.bash_profile
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> $HOME/.zshrc
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
    sleep 5
    brew install coreutils
    @@ -34,14 +35,6 @@ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:
    ##### change hostname #####
    sudo hostname acloudguru

    ##### install antigen #####
    brew install antigen
    echo "source /home/linuxbrew/.linuxbrew/share/antigen/antigen.zsh" >> ~/.zshrc

    ##### add zsh autosuggestions #####
    echo "antigen bundle zsh-users/zsh-autosuggestions" >> ~/.zshrc



    ##### install aws cli #####
    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
    @@ -70,8 +63,49 @@ curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyr


    brew install kubectl

    znap fpath _kubectl 'kubectl completion zsh'
    znap restart
    brew install lsd
    ############################################
    ############################################

    ##### install znap #####
    git clone --depth 1 -- https://github.com/marlonrichert/zsh-snap.git
    source zsh-snap/install.zsh

    ##### example of config (add to zsrc file #####
    # Download Znap, if it's not there yet.
    [[ -f ~/Git/zsh-snap/znap.zsh ]] ||
    git clone --depth 1 -- \
    https://github.com/marlonrichert/zsh-snap.git ~/Git/zsh-snap

    source ~/Git/zsh-snap/znap.zsh # Start Znap

    # `znap prompt` makes your prompt visible in just 15-40ms!
    znap prompt sindresorhus/pure

    # `znap source` automatically downloads and starts your plugins.
    znap source marlonrichert/zsh-autocomplete
    znap source zsh-users/zsh-autosuggestions
    znap source zsh-users/zsh-syntax-highlighting

    # `znap eval` caches and runs any kind of command output for you.
    znap eval iterm2 'curl -fsSL https://iterm2.com/shell_integration/zsh'

    # `znap function` lets you lazy-load features you don't always need.
    znap function _pyenv pyenvn 'eval "$( pyenv init - --no-rehash )"'
    compctl -K _pyenv pyenv

    ############################################
    ############################################


    #### vagrant
    brew install vagrant
    ### download and intall vmaware plugin
    wget https://releases.hashicorp.com/vagrant-vmware-utility/1.0.21/vagrant-vmware-utility_1.0.21_x86_64.dmg
    ## run vmware plugin
    vagrant plugin install vagrant-vmware-desktop
    vagrant autocomplete install --bash --zsh

    ##### load config #####

  6. andrey-zh revised this gist Apr 8, 2022. 1 changed file with 6 additions and 159 deletions.
    165 changes: 6 additions & 159 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -9,14 +9,8 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/too

    ##### install brew #####
    NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    sleep 3
    export PATH="/home/cloud_user/.local/opt/brew/bin:$PATH"
    export PATH="/home/cloud_user/.local/opt/brew/sbin:$PATH"
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/cloud_user/.profile
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
    export PATH=$HOME/bin:/usr/local/bin:$PATH
    sleep 5
    brew install coreutils



    ##### install vim plugins #####
    curl -sS https://webinstall.dev/nerdfont | bash
    @@ -29,6 +23,10 @@ curl -sS https://webinstall.dev/vim-prettier | bash
    curl -sS https://webinstall.dev/vim-ale | bash
    curl -sS https://webinstall.dev/vim-lastplace | bash

    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/cloud_user/.profile
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
    sleep 5
    brew install coreutils

    ##### add syntax highlighting #####
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
    @@ -76,155 +74,4 @@ brew install kubectl
    brew install lsd

    ##### load config #####
    echo '# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
    # Initialization code that may require console input (password prompts, [y/n]
    # confirmations, etc.) must go above this block; everything else may go below.
    if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
    source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
    fi
    # If you come from bash you might have to change your $PATH.
    # export PATH=$HOME/bin:/usr/local/bin:$PATH
    # Path to your oh-my-zsh installation.
    export ZSH="/Users/andrew/.oh-my-zsh"
    # Set name of the theme to load --- if set to "random", it will
    # load a random theme each time oh-my-zsh is loaded, in which case,
    # to know which specific one was loaded, run: echo $RANDOM_THEME
    # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
    ZSH_THEME="intheloop"
    # Set list of themes to pick from when loading at random
    # Setting this variable when ZSH_THEME=random will cause zsh to load
    # a theme from this variable instead of looking in $ZSH/themes/
    # If set to an empty array, this variable will have no effect.
    # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
    # Uncomment the following line to use case-sensitive completion.
    # CASE_SENSITIVE="true"
    # Uncomment the following line to use hyphen-insensitive completion.
    # Case-sensitive completion must be off. _ and - will be interchangeable.
    # HYPHEN_INSENSITIVE="true"
    # Uncomment the following line to disable bi-weekly auto-update checks.
    # DISABLE_AUTO_UPDATE="true"
    # Uncomment the following line to automatically update without prompting.
    # DISABLE_UPDATE_PROMPT="true"
    # Uncomment the following line to change how often to auto-update (in days).
    # export UPDATE_ZSH_DAYS=13
    # Uncomment the following line if pasting URLs and other text is messed up.
    # DISABLE_MAGIC_FUNCTIONS="true"
    # Uncomment the following line to disable colors in ls.
    # DISABLE_LS_COLORS="true"
    # Uncomment the following line to disable auto-setting terminal title.
    # DISABLE_AUTO_TITLE="true"
    # Uncomment the following line to enable command auto-correction.
    # ENABLE_CORRECTION="true"
    # Uncomment the following line to display red dots whilst waiting for completion.
    # COMPLETION_WAITING_DOTS="true"
    # Uncomment the following line if you want to disable marking untracked files
    # under VCS as dirty. This makes repository status check for large repositories
    # much, much faster.
    # DISABLE_UNTRACKED_FILES_DIRTY="true"
    # Uncomment the following line if you want to change the command execution time
    # stamp shown in the history command output.
    # You can set one of the optional three formats:
    # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
    # or set a custom format using the strftime function format specifications,
    # see "man strftime" for details.
    # HIST_STAMPS="mm/dd/yyyy"
    # Would you like to use another custom folder than $ZSH/custom?
    # ZSH_CUSTOM=/path/to/new-custom-folder
    # Which plugins would you like to load?
    # Standard plugins can be found in $ZSH/plugins/
    # Custom plugins may be added to $ZSH_CUSTOM/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    # Add wisely, as too many plugins slow down shell startup.
    plugins=(
    git
    zsh-autosuggestions
    docker
    docker-compose
    zsh-completions
    zsh-syntax-highlighting
    z
    )
    autoload -U compinit && compinit
    source $ZSH/oh-my-zsh.sh
    # User configuration
    # export MANPATH="/usr/local/man:$MANPATH"
    # You may need to manually set your language environment
    # export LANG=en_US.UTF-8
    # Preferred editor for local and remote sessions
    # if [[ -n $SSH_CONNECTION ]]; then
    # export EDITOR="vim"
    # else
    # export EDITOR="mvim"
    # fi
    # Compilation flags
    # export ARCHFLAGS="-arch x86_64"
    # Set personal aliases, overriding those provided by oh-my-zsh libs,
    # plugins, and themes. Aliases can be placed here, though oh-my-zsh
    # users are encouraged to define aliases within the ZSH_CUSTOM folder.
    # For a full list of active aliases, run `alias`.
    #
    # Example aliases
    # alias zshconfig="mate ~/.zshrc"
    # alias ohmyzsh="mate ~/.oh-my-zsh"
    alias tree="lsd -AF --tree"
    # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
    fpath=(/opt/v/embedded/gems/2.2.18/gems/vagrant-2.2.18/contrib/zsh $fpath)
    compinit
    # fuzzy search plugin
    [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
    export PATH="/usr/local/sbin:$PATH"
    # VS code .
    export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
    # terraform autocomplete
    autoload -U +X bashcompinit && bashcompinit
    autoload -Uz compinit && compinit
    complete -o nospace -C /usr/local/bin/terraform terraform
    # kubectl autocomlete
    source <(kubectl completion zsh)
    # packer autocomplete
    complete -o nospace -C /usr/local/bin/packer packer
    # aws autocomplete
    autoload bashcompinit && bashcompinit
    autoload -Uz compinit && compinit
    complete -C "/usr/local/bin/aws_completer" aws
    complete -o nospace -C /usr/local/bin/vault vault
    # Generated for envman. Do not edit.
    [ -s "$HOME/.config/envman/load.sh" ] && source "$HOME/.config/envman/load.sh"
    ' > ~/.zshrc

  7. andrey-zh revised this gist Apr 7, 2022. 1 changed file with 8 additions and 6 deletions.
    14 changes: 8 additions & 6 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,13 @@
    ##### install brew #####
    ##### install updates #####
    sudo apt-get update
    sudo apt-get install build-essential -y

    ##### install zsh #####
    sudo apt-get install zsh -y
    chsh -s $(which zsh)
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

    ##### install brew #####
    NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    sleep 3
    export PATH="/home/cloud_user/.local/opt/brew/bin:$PATH"
    @@ -11,11 +18,6 @@ export PATH=$HOME/bin:/usr/local/bin:$PATH
    sleep 5
    brew install coreutils

    ##### install zsh #####
    sudo apt-get install zsh -y
    chsh -s $(which zsh)
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

    ##### install vim plugins #####
    curl -sS https://webinstall.dev/nerdfont | bash
    export PATH="/home/cloud_user/.local/bin:$PATH"
  8. andrey-zh revised this gist Apr 7, 2022. 1 changed file with 1 addition and 10 deletions.
    11 changes: 1 addition & 10 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -27,8 +27,6 @@ curl -sS https://webinstall.dev/vim-prettier | bash
    curl -sS https://webinstall.dev/vim-ale | bash
    curl -sS https://webinstall.dev/vim-lastplace | bash

    ##### install pure theme #####
    brew install pure

    ##### add syntax highlighting #####
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
    @@ -42,7 +40,6 @@ echo "source /home/linuxbrew/.linuxbrew/share/antigen/antigen.zsh" >> ~/.zshrc

    ##### add zsh autosuggestions #####
    echo "antigen bundle zsh-users/zsh-autosuggestions" >> ~/.zshrc
    source ~/.zshrc



    @@ -73,9 +70,6 @@ curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyr


    brew install kubectl
    kubectl version --client
    echo "source <(kubectl completion zsh)" >> ~/.zshrc
    source ~/.zshrc

    brew install lsd

    @@ -97,7 +91,7 @@ export ZSH="/Users/andrew/.oh-my-zsh"
    # load a random theme each time oh-my-zsh is loaded, in which case,
    # to know which specific one was loaded, run: echo $RANDOM_THEME
    # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
    ZSH_THEME=""
    ZSH_THEME="intheloop"
    # Set list of themes to pick from when loading at random
    # Setting this variable when ZSH_THEME=random will cause zsh to load
    @@ -204,9 +198,6 @@ alias tree="lsd -AF --tree"
    fpath=(/opt/v/embedded/gems/2.2.18/gems/vagrant-2.2.18/contrib/zsh $fpath)
    compinit
    # pure theme
    autoload -U promptinit; promptinit
    prompt pure
    # fuzzy search plugin
    [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
  9. andrey-zh revised this gist Apr 7, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -67,7 +67,7 @@ brew tap hashicorp/tap
    brew install hashicorp/tap/packer
    packer -autocomplete-install

    sudo apt-get install apt-transport-https ca-certificates gnupg
    sudo apt-get install apt-transport-https ca-certificates gnupg -y
    echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
    curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

  10. andrey-zh revised this gist Apr 7, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,8 @@ export PATH="/home/cloud_user/.local/opt/brew/bin:$PATH"
    export PATH="/home/cloud_user/.local/opt/brew/sbin:$PATH"
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/cloud_user/.profile
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
    export PATH=$HOME/bin:/usr/local/bin:$PATH
    sleep 5
    brew install coreutils

    ##### install zsh #####
  11. andrey-zh revised this gist Apr 7, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,7 @@ brew install coreutils

    ##### install zsh #####
    sudo apt-get install zsh -y
    chsh -s $(which zsh)
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

    ##### install vim plugins #####
  12. andrey-zh revised this gist Apr 7, 2022. 1 changed file with 189 additions and 27 deletions.
    216 changes: 189 additions & 27 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,19 @@
    sudo apt-get update && sudo apt-get install zsh -y
    ##### install brew #####
    sudo apt-get update
    sudo apt-get install build-essential -y
    NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    sleep 3
    export PATH="/home/cloud_user/.local/opt/brew/bin:$PATH"
    export PATH="/home/cloud_user/.local/opt/brew/sbin:$PATH"
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/cloud_user/.profile
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
    brew install coreutils

    ##### install zsh #####
    sudo apt-get install zsh -y
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

    ##### install vim plugins #####
    curl -sS https://webinstall.dev/nerdfont | bash
    export PATH="/home/cloud_user/.local/bin:$PATH"
    curl -sS https://webinstall.dev/vim-nerdtree | bash
    @@ -10,42 +24,33 @@ curl -sS https://webinstall.dev/vim-prettier | bash
    curl -sS https://webinstall.dev/vim-ale | bash
    curl -sS https://webinstall.dev/vim-lastplace | bash

    NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    export PATH="/home/cloud_user/.local/opt/brew/bin:$PATH"
    export PATH="/home/cloud_user/.local/opt/brew/sbin:$PATH"
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/cloud_user/.profile
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
    sudo apt-get install build-essential -y
    brew update; brew upgrade
    brew install coreutils
    ##### install pure theme #####
    brew install pure
    echo "autoload -U promptinit; promptinit
    prompt pure" >> ~/.zshrc
    source ~/.zshrc

    ##### add syntax highlighting #####
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
    # plugins=( [plugins...] zsh-syntax-highlighting)
    # plugins=(
    # other plugins...
    #zsh-autosuggestions
    #)

    ##### change hostname #####
    sudo hostname acloudguru

    ##### install antigen #####
    brew install antigen
    echo "source /home/linuxbrew/.linuxbrew/share/antigen/antigen.zsh" >> ~/.zshrc
    antigen bundle zsh-users/zsh-autosuggestions
    antigen apply

    ##### add zsh autosuggestions #####
    echo "antigen bundle zsh-users/zsh-autosuggestions" >> ~/.zshrc
    source ~/.zshrc
    # plugins=(... fzf)



    ##### install aws cli #####
    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
    unzip awscliv2.zip
    sudo ./aws/install
    find / -name aws_completer
    #/usr/local/bin/aws_completer
    export PATH=/usr/local/bin/:$PATH
    echo "autoload bashcompinit && bashcompinit
    autoload -Uz compinit && compinit" >> ~/.zshrc
    echo "complete -C '/usr/local/bin/aws_completer' aws" >> ~/.zshrc
    source ~/.zshrc
    #echo "autoload bashcompinit && bashcompinit
    #autoload -Uz compinit && compinit" >> ~/.zshrc
    #echo "complete -C '/usr/local/bin/aws_completer' aws" >> ~/.zshrc
    #source ~/.zshrc

    brew tap hashicorp/tap
    brew install hashicorp/tap/terraform
    @@ -70,3 +75,160 @@ echo "source <(kubectl completion zsh)" >> ~/.zshrc
    source ~/.zshrc

    brew install lsd

    ##### load config #####
    echo '# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
    # Initialization code that may require console input (password prompts, [y/n]
    # confirmations, etc.) must go above this block; everything else may go below.
    if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
    source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
    fi
    # If you come from bash you might have to change your $PATH.
    # export PATH=$HOME/bin:/usr/local/bin:$PATH
    # Path to your oh-my-zsh installation.
    export ZSH="/Users/andrew/.oh-my-zsh"
    # Set name of the theme to load --- if set to "random", it will
    # load a random theme each time oh-my-zsh is loaded, in which case,
    # to know which specific one was loaded, run: echo $RANDOM_THEME
    # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
    ZSH_THEME=""
    # Set list of themes to pick from when loading at random
    # Setting this variable when ZSH_THEME=random will cause zsh to load
    # a theme from this variable instead of looking in $ZSH/themes/
    # If set to an empty array, this variable will have no effect.
    # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
    # Uncomment the following line to use case-sensitive completion.
    # CASE_SENSITIVE="true"
    # Uncomment the following line to use hyphen-insensitive completion.
    # Case-sensitive completion must be off. _ and - will be interchangeable.
    # HYPHEN_INSENSITIVE="true"
    # Uncomment the following line to disable bi-weekly auto-update checks.
    # DISABLE_AUTO_UPDATE="true"
    # Uncomment the following line to automatically update without prompting.
    # DISABLE_UPDATE_PROMPT="true"
    # Uncomment the following line to change how often to auto-update (in days).
    # export UPDATE_ZSH_DAYS=13
    # Uncomment the following line if pasting URLs and other text is messed up.
    # DISABLE_MAGIC_FUNCTIONS="true"
    # Uncomment the following line to disable colors in ls.
    # DISABLE_LS_COLORS="true"
    # Uncomment the following line to disable auto-setting terminal title.
    # DISABLE_AUTO_TITLE="true"
    # Uncomment the following line to enable command auto-correction.
    # ENABLE_CORRECTION="true"
    # Uncomment the following line to display red dots whilst waiting for completion.
    # COMPLETION_WAITING_DOTS="true"
    # Uncomment the following line if you want to disable marking untracked files
    # under VCS as dirty. This makes repository status check for large repositories
    # much, much faster.
    # DISABLE_UNTRACKED_FILES_DIRTY="true"
    # Uncomment the following line if you want to change the command execution time
    # stamp shown in the history command output.
    # You can set one of the optional three formats:
    # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
    # or set a custom format using the strftime function format specifications,
    # see "man strftime" for details.
    # HIST_STAMPS="mm/dd/yyyy"
    # Would you like to use another custom folder than $ZSH/custom?
    # ZSH_CUSTOM=/path/to/new-custom-folder
    # Which plugins would you like to load?
    # Standard plugins can be found in $ZSH/plugins/
    # Custom plugins may be added to $ZSH_CUSTOM/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    # Add wisely, as too many plugins slow down shell startup.
    plugins=(
    git
    zsh-autosuggestions
    docker
    docker-compose
    zsh-completions
    zsh-syntax-highlighting
    z
    )
    autoload -U compinit && compinit
    source $ZSH/oh-my-zsh.sh
    # User configuration
    # export MANPATH="/usr/local/man:$MANPATH"
    # You may need to manually set your language environment
    # export LANG=en_US.UTF-8
    # Preferred editor for local and remote sessions
    # if [[ -n $SSH_CONNECTION ]]; then
    # export EDITOR="vim"
    # else
    # export EDITOR="mvim"
    # fi
    # Compilation flags
    # export ARCHFLAGS="-arch x86_64"
    # Set personal aliases, overriding those provided by oh-my-zsh libs,
    # plugins, and themes. Aliases can be placed here, though oh-my-zsh
    # users are encouraged to define aliases within the ZSH_CUSTOM folder.
    # For a full list of active aliases, run `alias`.
    #
    # Example aliases
    # alias zshconfig="mate ~/.zshrc"
    # alias ohmyzsh="mate ~/.oh-my-zsh"
    alias tree="lsd -AF --tree"
    # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
    fpath=(/opt/v/embedded/gems/2.2.18/gems/vagrant-2.2.18/contrib/zsh $fpath)
    compinit
    # pure theme
    autoload -U promptinit; promptinit
    prompt pure
    # fuzzy search plugin
    [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
    export PATH="/usr/local/sbin:$PATH"
    # VS code .
    export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
    # terraform autocomplete
    autoload -U +X bashcompinit && bashcompinit
    autoload -Uz compinit && compinit
    complete -o nospace -C /usr/local/bin/terraform terraform
    # kubectl autocomlete
    source <(kubectl completion zsh)
    # packer autocomplete
    complete -o nospace -C /usr/local/bin/packer packer
    # aws autocomplete
    autoload bashcompinit && bashcompinit
    autoload -Uz compinit && compinit
    complete -C "/usr/local/bin/aws_completer" aws
    complete -o nospace -C /usr/local/bin/vault vault
    # Generated for envman. Do not edit.
    [ -s "$HOME/.config/envman/load.sh" ] && source "$HOME/.config/envman/load.sh"
    ' > ~/.zshrc

  13. andrey-zh revised this gist Apr 7, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,5 @@
    sudo apt-get update && sudo apt-get install zsh -y
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
    zsh
    sudo snap install lsd
    curl -sS https://webinstall.dev/nerdfont | bash
    export PATH="/home/cloud_user/.local/bin:$PATH"
    curl -sS https://webinstall.dev/vim-nerdtree | bash
    @@ -19,6 +17,7 @@ echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/cloud_use
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
    sudo apt-get install build-essential -y
    brew update; brew upgrade
    brew install coreutils
    brew install pure
    echo "autoload -U promptinit; promptinit
    prompt pure" >> ~/.zshrc
    @@ -70,3 +69,4 @@ kubectl version --client
    echo "source <(kubectl completion zsh)" >> ~/.zshrc
    source ~/.zshrc

    brew install lsd
  14. andrey-zh revised this gist Apr 7, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    sudo apt-get update && sudo apt-get install zsh -y
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
    zsh
    sudo snap install lsd
    curl -sS https://webinstall.dev/nerdfont | bash
    export PATH="/home/cloud_user/.local/bin:$PATH"
  15. andrey-zh revised this gist Apr 7, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ curl -sS https://webinstall.dev/vim-prettier | bash
    curl -sS https://webinstall.dev/vim-ale | bash
    curl -sS https://webinstall.dev/vim-lastplace | bash

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    export PATH="/home/cloud_user/.local/opt/brew/bin:$PATH"
    export PATH="/home/cloud_user/.local/opt/brew/sbin:$PATH"
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/cloud_user/.profile
  16. andrey-zh revised this gist Apr 7, 2022. 2 changed files with 68 additions and 108 deletions.
    71 changes: 68 additions & 3 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,71 @@
    sudo apt-get update && sudo apt-get install zsh -y
    git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
    sudo apt-get install fonts-powerline -y
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
    sudo snap install lsd
    curl -sS https://webinstall.dev/nerdfont | bash
    export PATH="/home/cloud_user/.local/bin:$PATH"
    export PATH="/home/cloud_user/.local/bin:$PATH"
    curl -sS https://webinstall.dev/vim-nerdtree | bash
    export PATH="/home/cloud_user/.local/bin:$PATH"
    curl -sS https://webinstall.dev/myip | bash
    export PATH="/home/cloud_user/.local/bin:$PATH"
    curl -sS https://webinstall.dev/vim-prettier | bash
    curl -sS https://webinstall.dev/vim-ale | bash
    curl -sS https://webinstall.dev/vim-lastplace | bash

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    export PATH="/home/cloud_user/.local/opt/brew/bin:$PATH"
    export PATH="/home/cloud_user/.local/opt/brew/sbin:$PATH"
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/cloud_user/.profile
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
    sudo apt-get install build-essential -y
    brew update; brew upgrade
    brew install pure
    echo "autoload -U promptinit; promptinit
    prompt pure" >> ~/.zshrc
    source ~/.zshrc
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
    # plugins=( [plugins...] zsh-syntax-highlighting)
    # plugins=(
    # other plugins...
    #zsh-autosuggestions
    #)
    sudo hostname acloudguru
    brew install antigen
    echo "source /home/linuxbrew/.linuxbrew/share/antigen/antigen.zsh" >> ~/.zshrc
    antigen bundle zsh-users/zsh-autosuggestions
    antigen apply
    source ~/.zshrc
    # plugins=(... fzf)

    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
    unzip awscliv2.zip
    sudo ./aws/install
    find / -name aws_completer
    #/usr/local/bin/aws_completer
    export PATH=/usr/local/bin/:$PATH
    echo "autoload bashcompinit && bashcompinit
    autoload -Uz compinit && compinit" >> ~/.zshrc
    echo "complete -C '/usr/local/bin/aws_completer' aws" >> ~/.zshrc
    source ~/.zshrc

    brew tap hashicorp/tap
    brew install hashicorp/tap/terraform
    terraform -install-autocomplete

    brew tap hashicorp/tap
    brew install hashicorp/tap/vault
    vault -autocomplete-install

    brew tap hashicorp/tap
    brew install hashicorp/tap/packer
    packer -autocomplete-install

    sudo apt-get install apt-transport-https ca-certificates gnupg
    echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
    curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -


    brew install kubectl
    kubectl version --client
    echo "source <(kubectl completion zsh)" >> ~/.zshrc
    source ~/.zshrc

    105 changes: 0 additions & 105 deletions 2-install-oh-my-zsh.sh
    Original file line number Diff line number Diff line change
    @@ -1,105 +0,0 @@
    main() {
    # Use colors, but only if connected to a terminal, and that terminal
    # supports them.
    if which tput >/dev/null 2>&1; then
    ncolors=$(tput colors)
    fi
    if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
    RED="$(tput setaf 1)"
    GREEN="$(tput setaf 2)"
    YELLOW="$(tput setaf 3)"
    BLUE="$(tput setaf 4)"
    BOLD="$(tput bold)"
    NORMAL="$(tput sgr0)"
    else
    RED=""
    GREEN=""
    YELLOW=""
    BLUE=""
    BOLD=""
    NORMAL=""
    fi

    # Only enable exit-on-error after the non-critical colorization stuff,
    # which may fail on systems lacking tput or terminfo
    set -e

    CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l)
    if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then
    printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"
    exit
    fi
    unset CHECK_ZSH_INSTALLED

    if [ ! -n "$ZSH" ]; then
    ZSH=~/.oh-my-zsh
    fi

    # Prevent the cloned repository from having insecure permissions. Failing to do
    # so causes compinit() calls to fail with "command not found: compdef" errors
    # for users with insecure umasks (e.g., "002", allowing group writability). Note
    # that this will be ignored under Cygwin by default, as Windows ACLs take
    # precedence over umasks except for filesystems mounted with option "noacl".
    umask g-w,o-w

    printf "${BLUE}Cloning Oh My Zsh...${NORMAL}\n"
    hash git >/dev/null 2>&1 || {
    echo "Error: git is not installed"
    exit 1
    }
    # The Windows (MSYS) Git is not compatible with normal use on cygwin
    if [ "$OSTYPE" = cygwin ]; then
    if git --version | grep msysgit > /dev/null; then
    echo "Error: Windows/MSYS Git is not supported on Cygwin"
    echo "Error: Make sure the Cygwin git package is installed and is first on the path"
    exit 1
    fi
    fi

    printf "${BLUE}Looking for an existing zsh config...${NORMAL}\n"
    if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
    printf "${YELLOW}Found ~/.zshrc.${NORMAL} ${GREEN}Backing up to ~/.zshrc.pre-oh-my-zsh${NORMAL}\n";
    mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
    fi

    printf "${BLUE}Using the Oh My Zsh template file and adding it to ~/.zshrc${NORMAL}\n"
    cp $ZSH/templates/zshrc.zsh-template ~/.zshrc
    sed "/^export ZSH=/ c\\
    export ZSH=$ZSH
    " ~/.zshrc > ~/.zshrc-omztemp
    mv -f ~/.zshrc-omztemp ~/.zshrc

    # If this user's login shell is not already "zsh", attempt to switch.
    TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
    if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
    # If this platform provides a "chsh" command (not Cygwin), do it, man!
    if hash chsh >/dev/null 2>&1; then
    printf "${BLUE}Time to change your default shell to zsh!${NORMAL}\n"
    chsh -s $(grep /zsh$ /etc/shells | tail -1)
    # Else, suggest the user do so manually.
    else
    printf "I can't change your shell automatically because this system does not have chsh.\n"
    printf "${BLUE}Please manually change your default shell to zsh!${NORMAL}\n"
    fi
    fi

    printf "${GREEN}"
    echo ' __ __ '
    echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ '
    echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '
    echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '
    echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '
    echo ' /____/ ....is now installed!'
    echo ''
    echo ''
    echo 'Please look over the ~/.zshrc file to select plugins, themes, and options.'
    echo ''
    echo 'p.s. Follow us at https://twitter.com/ohmyzsh.'
    echo ''
    echo 'p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.'
    echo ''
    printf "${NORMAL}"
    env zsh
    }

    main
  17. andrey-zh revised this gist Apr 7, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    sudo apt-get update && sudo apt-get install zsh -y
    git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
    sudo apt-get install fonts-powerline -y
    sudo snap install lsd -y
    sudo snap install lsd
    curl -sS https://webinstall.dev/nerdfont | bash
    export PATH="/home/cloud_user/.local/bin:$PATH"
  18. andrey-zh created this gist Apr 7, 2022.
    6 changes: 6 additions & 0 deletions 1-install-zsh-lsd.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    sudo apt-get update && sudo apt-get install zsh -y
    git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
    sudo apt-get install fonts-powerline -y
    sudo snap install lsd -y
    curl -sS https://webinstall.dev/nerdfont | bash
    export PATH="/home/cloud_user/.local/bin:$PATH"
    105 changes: 105 additions & 0 deletions 2-install-oh-my-zsh.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,105 @@
    main() {
    # Use colors, but only if connected to a terminal, and that terminal
    # supports them.
    if which tput >/dev/null 2>&1; then
    ncolors=$(tput colors)
    fi
    if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
    RED="$(tput setaf 1)"
    GREEN="$(tput setaf 2)"
    YELLOW="$(tput setaf 3)"
    BLUE="$(tput setaf 4)"
    BOLD="$(tput bold)"
    NORMAL="$(tput sgr0)"
    else
    RED=""
    GREEN=""
    YELLOW=""
    BLUE=""
    BOLD=""
    NORMAL=""
    fi

    # Only enable exit-on-error after the non-critical colorization stuff,
    # which may fail on systems lacking tput or terminfo
    set -e

    CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l)
    if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then
    printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"
    exit
    fi
    unset CHECK_ZSH_INSTALLED

    if [ ! -n "$ZSH" ]; then
    ZSH=~/.oh-my-zsh
    fi

    # Prevent the cloned repository from having insecure permissions. Failing to do
    # so causes compinit() calls to fail with "command not found: compdef" errors
    # for users with insecure umasks (e.g., "002", allowing group writability). Note
    # that this will be ignored under Cygwin by default, as Windows ACLs take
    # precedence over umasks except for filesystems mounted with option "noacl".
    umask g-w,o-w

    printf "${BLUE}Cloning Oh My Zsh...${NORMAL}\n"
    hash git >/dev/null 2>&1 || {
    echo "Error: git is not installed"
    exit 1
    }
    # The Windows (MSYS) Git is not compatible with normal use on cygwin
    if [ "$OSTYPE" = cygwin ]; then
    if git --version | grep msysgit > /dev/null; then
    echo "Error: Windows/MSYS Git is not supported on Cygwin"
    echo "Error: Make sure the Cygwin git package is installed and is first on the path"
    exit 1
    fi
    fi

    printf "${BLUE}Looking for an existing zsh config...${NORMAL}\n"
    if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
    printf "${YELLOW}Found ~/.zshrc.${NORMAL} ${GREEN}Backing up to ~/.zshrc.pre-oh-my-zsh${NORMAL}\n";
    mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
    fi

    printf "${BLUE}Using the Oh My Zsh template file and adding it to ~/.zshrc${NORMAL}\n"
    cp $ZSH/templates/zshrc.zsh-template ~/.zshrc
    sed "/^export ZSH=/ c\\
    export ZSH=$ZSH
    " ~/.zshrc > ~/.zshrc-omztemp
    mv -f ~/.zshrc-omztemp ~/.zshrc

    # If this user's login shell is not already "zsh", attempt to switch.
    TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
    if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
    # If this platform provides a "chsh" command (not Cygwin), do it, man!
    if hash chsh >/dev/null 2>&1; then
    printf "${BLUE}Time to change your default shell to zsh!${NORMAL}\n"
    chsh -s $(grep /zsh$ /etc/shells | tail -1)
    # Else, suggest the user do so manually.
    else
    printf "I can't change your shell automatically because this system does not have chsh.\n"
    printf "${BLUE}Please manually change your default shell to zsh!${NORMAL}\n"
    fi
    fi

    printf "${GREEN}"
    echo ' __ __ '
    echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ '
    echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '
    echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '
    echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '
    echo ' /____/ ....is now installed!'
    echo ''
    echo ''
    echo 'Please look over the ~/.zshrc file to select plugins, themes, and options.'
    echo ''
    echo 'p.s. Follow us at https://twitter.com/ohmyzsh.'
    echo ''
    echo 'p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.'
    echo ''
    printf "${NORMAL}"
    env zsh
    }

    main