Oh-my-zsh is an extension of the traditional z shell that is extensible via community created plugins (Plugins found here: oh-my-zsh github repo). It is, in my opinion, a breath of fresh air in comparison to the traditional bash shell.
DO THE FOLLOWING IN ORDER
The first step for this install is getting zsh
we will do this via yum. From your terminal:
sudo yum install zsh
Follow the install (there may be some prompts that you have to go through asking about using different mirrors, typically you can y
through these.
After installing zsh execute the following command:
wget --no-check-certificate http://install.ohmyz.sh -O - | sh
This will fetch oh-my-zsh
for you and create a .zshrc
file based on the oh-my-zsh
config template.
NOTE: This will automagically add the PATH
vars from the existing .bashrc
and .bash_profile
files to your config (YAY!)
Typically on an OS X install of oh-my-zsh
the shell will be changed automatically. However this step will fail on THIS fedora image (I don't know if it's on all of them). So after installing oh-my-zsh
you will need to run the following command:
sudo chsh -s /usr/bin/zsh
This will set your default shell to ZSH.
NOTE: You will need to log out and log back in to see this change, just rebooting your terminal will not do
Bro. McLaughlin has given us some some terminal niceties that we want so we are going to go get those.
The following command will open up the .zshrc
file for you. This file will have a lot of oh-my-zsh
specific things in it (I'll give a potential set up for you) for now don't worry about those.
gedit ~/.zshrc
Then copy and paste the following block at the BOTTOM of the file:
# Set the JAVA_HOME path.
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75-2.5.4.2.fc20.x86_64
# Set the CLASSPATH path.
export CLASSPATH=/usr/share/java/mysql-connector-java.jar:.
# User specific aliases and functions
. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
# Wrap sqlplus with rlwrap to edit prior lines with the
# up, down, left and right keys.
sqlplus()
{
if [ "$RLWRAP" = "0" ]; then
sqlplus "$@"
else
rlwrap sqlplus "$@"
fi
}
# Set the bindkey.
bindkey -v
bindkey "^R" history-incremental-search-backward
export EDITOR="vim"
# history stuff
HISTFILE=~/.zsh-histfile
HISTSIZE=2000
# Set vi as a command line editor.
set -o vi
Reboot your terminal (not your machine) and you should be good to go!
I have a very specific configuration that I like for my terminal in terms of look so I figured that I would post that here as well.
By default the oh-my-zsh theme is set to robbyrussell
. I personally don't like this I prefer a modified version of a different theme. On line 8 change
ZSH_THEME="robbyrussell"
TO:
ZSH_THEME="agnoster"
Now if you reboot your terminal it'll look nice and gross. We need to change the terminal font to allow for some niceness. Click THIS LINK and download the font.
There is probably a better way to do this BUT I am just trying to get this to work and this is what I found that works. Only if you simply downloaded the file into the downloads directory then executing the following command will take care of the copy and install.
*NOTE: If you downloaded the file into a different directory then simply replace ~/Downloads/Inconsolata+for+Powerline.otf
with the path to your file
sudo mkdir /usr/share/fonts/inconsolata && sudo cp ~/Downloads/Inconsolata+for+Powerline.otf /usr/share/fonts/inconsolata/inconsolata.otf && sudo fc-cache -v
After doing this jump into your terminal profile (Edit/Profile Preferences) click off the "Use the system fixed width font" box and change the font to "Inconsolata Light"
After doing this change your font size to your liking and you are good to go!
'Sudo chsh -s /usr/bin/zsh' changes root's shell which is OK but probably not what you had in mind. To change user's shell, run the command without sudo and it will ask for user's password and then change user's shell. A mystery why the script can't handle this, though.