#! /bin/bash

# Kompilasi alat-alat tambahan selama berinteraksi dengan lingkungan CLI
# Sebagian besar dapat berjalan pada distro Debian dan turunannya
# Namun untuk distro Linux lainnya pun bisa
# Terapkan pada pengguna non-root sudo

# Nama pengguna non sudo yang akan digunakan
# nonSudo="deploy"
#
# sudo passwd $nonSudo
#
# oh-my-zsh - https://github.com/robbyrussell/oh-my-zsh
# https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
#
# ubah shell menjadi zsh secara manual
# chsh -s $(which zsh)
#
# zsh-syntax-highlighting - https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md
# zsh-autosuggestions - https://github.com/zsh-users/zsh-autosuggestions
# nanorc - https://github.com/scopatz/nanorc
# Improved Nano Syntax Highlighting Files
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && \
  git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && \
  git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions && \
  curl https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh | sh
#
# nano ~/.zshrc
cp ~/.zshrc ~/.zshrc.orig
cat << EOF > ~/.zshrc
#
  export ZSH="$HOME/.oh-my-zsh"
#
ZSH_THEME="bira"
#
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# 
plugins=(
  colored-man-pages
  colorize
  command-not-found
  common-aliases
  debian
  docker
  docker-compose
  git
  history
  pip
  python
  sudo
  systemd
  zsh-autosuggestions
  zsh-completions
  zsh-syntax-highlighting
)

source \$ZSH/oh-my-zsh.sh
EOF
#
#
autoload -U compinit && compinit

source ~/.zshrc
