# Zsh general #### Install zsh ``` sudo aptitude install zsh ``` #### Make zsh default shell ``` whereis zsh # this usually returns /usr/bin/zsh sudo usermod -s /usr/bin/zsh $(whoami) ``` #### Reboot linux, after this select 2 in the prompt - (2) Populate your .zshrc with configuration recommended #### Install oh-my-zsh - ref https://github.com/ohmyzsh/ohmyzsh#basic-installation ``` sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" ``` #### Install zsh-syntax-highlighting - ref https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md#oh-my-zsh ``` git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ``` ##### Add to ~/.zshrc (just copy entire `.zshrc`) plugins=( [plugins...] zsh-syntax-highlighting) #### Enable kubernetes autocomletion: add to `.zshrc` (just copy entire `.zshrc`) - ref https://kubernetes.io/docs/tasks/tools/included/optional-kubectl-configs-zsh/ ``` source <(kubectl completion zsh) ``` #### Install fzf - https://gist.github.com/927578f824c0573831db7de1047a8d03#file-fzf-setup-sh #### Install fzf-tab - replace zsh default autocompletion (for cd) - https://github.com/Aloxaf/fzf-tab#oh-my-zsh ``` git clone https://github.com/Aloxaf/fzf-tab ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab ``` # Spaceship prompt plugin #### Install spaceship plugin - ref https://github.com/spaceship-prompt/spaceship-prompt#oh-my-zsh - options https://github.com/spaceship-prompt/spaceship-prompt/blob/master/docs/options.md - example preset config: https://medium.com/@goangle/my-awesome-zsh-weapon-2745cd34735d ``` git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1 ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme" ``` ##### Add to `.zshrc` (just copy entire `.zshrc`) Set `ZSH_THEME="spaceship"` in your `.zshrc` #### Rename context to make prompt shorter ``` kubectl config rename-context kirilllapshin-saas-dev.k8s.congenica.net saas-dev ``` #### Other references to configure `.zshenv` - emoji db ref: https://emojidb.org/ for suffixes (already used in `.zshenv`) - xterm 256 colors ref: https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg