This will be the steps to setup my (very opinionated) shell environment. Many things may go wrong (environmental variables, paths, etc), but this could be a great learning opertunity.
Use the man command for help! Man pages are viewed in less
, try
man less
to learn how to navigate them better!
curl https://nixos.org/nix/install | sh
Restart your shell to refresh the environment.
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update
nix-env -i coreutils zsh oh-my-zsh
Append the following to ~/.zshrc
and restart your shell:
if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then
. $HOME/.nix-profile/etc/profile.d/nix.sh
fi
export MANPATH="$MANPATH:$NIX_LINK/share/man"
In your terminal preferences, set /bin/zsh
to run at startup and
restart it.
Edit ~/.zshrc
to customize zsh, give it a read.
The theme I use in zsh is sunrise.
I suggest setting your terminal theme to solarized. Readable themes makes your pair partner happy.
I suggest using Anonymous Pro Bold in terminals (20+ pt) and programming (18+ pt). Large fonts makes your pair partner happy.
Semi-backwards compatible with Bash, but with much better interactive support.
Community driven framework for managing zsh. Has many themes, plugins, and shortcuts.
The core GNU command line tools. These are shell powertools and make your OSX command line more standardized. Read about them here.
Use ~/.zsh_funcs
to store functions you write, and ~/.zsh_aliases
to store your shell aliases.
Here is a helpful function (with completion support) for working with aliases:
# ~/.zsh_funcs
save_alias () {
cmd=`alias $1`
echo alias $cmd >> ~/.zsh_aliases
}
_save_alias () {
temp=`alias | sed -e 's/=.*//'`
_arguments "1:alias:($temp)"
}
compdef _save_alias save_alias
Here is is an example:
# Alias a commonly used command
$ alias rl='readlink -f'
# Try it out
$ pwd
/Users/Carl
$ rl symlinkDir
/Users/carl/projects/realDir
# Save it for future use
save_alias rl