Skip to content

Instantly share code, notes, and snippets.

@jclosure
Created August 2, 2017 19:29
Show Gist options
  • Save jclosure/36b42382087ec9baa1a84a325529379a to your computer and use it in GitHub Desktop.
Save jclosure/36b42382087ec9baa1a84a325529379a to your computer and use it in GitHub Desktop.
Setup Debian/Ubuntu with oh-my-zsh

Install and setup oh-my-zsh - Add hostname to your prompt so you can tell it apart from mac's shell

sudo apt-get install zsh
sudo apt-get install git-core
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Change default shell to zsh

if you are on an ldap controlled centralized system (e.g. getent passwd), use the following to override your shell locally. Otherwise just use chsh, wich will change your shell in your local /etc/passwd.

vim ~/.profile

Edit with (skip in favor of chsh if possible):

# COMMENT OUT THE ORIGINAL BASH STANZA OF THIS
# SWITCH FROM BASH TO ZSH FOR OH-MY-ZSH
if [ "$SHELL" != "/bin/zsh" ]
then
    export SHELL="/bin/zsh"
    exec /bin/zsh -l    # -l: login shell again
fi

Derive your custom theme from robbyrussell's

cd ~/.oh-my.zsh/themes
cp robbyrussell.zsh-theme mytheme.zsh-theme
vim mytheme.zsh-theme

Change prompt to:

PROMPT='%{$fg_bold[white]%}%M ${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
vim ~/.zshrc

Change

ZSH_THEME="mytheme"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment