2024 macOS Dotfiles

・2 min read

It is the time of year again where I decide to update my local computer configuration, as well as any remote linux server(s) that I am maintaining. I really appreciate having a familiar prompt and alias setup whenever I login to any of my servers/workstations.

As per usual, I cannot remember which specific packages and plugins I use; so I’ve am using this post for future me to discover how I actually configured my environments.

oh-my-zsh

ZSH is a must for me now, after using it for many years now. This is a simple process which can be read at https://ohmyz.sh/ but for reference, the following command will install oh-my-zsh:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

There are a few changes I then made to the .zshrc file, which I’ve listed below. You will recieve errors when using these changes until you complete the remaining steps listed below.

Add or update the following lines of .zshrc:

ZSH_THEME="powerlevel10k/powerlevel10k"
plugins=(git tmux)
# Zplug Section

source ~/.zplug/init.zsh

zplug "zsh-users/zsh-autosuggestions"   # Auto suggest command completions as you type
zplug "zsh-users/zsh-syntax-highlighting", from:github  # Command syntax highlighting
zplug "RobertAudi/tsm"  # tmux session manager. Handy short hand for tmux session management
zplug "bobsoppe/zsh-ssh-agent", use:ssh-agent.zsh, from:github # Setup the ssh agent

if ! zplug check; then
 zplug install
fi

zplug load

oh-my-tmux

Another ready to go package is oh-my-tmux. Again, this is plug and play from https://github.com/gpakosz/.tmux

$ cd
$ git clone https://github.com/gpakosz/.tmux.git
$ ln -s -f .tmux/.tmux.conf
$ cp .tmux/.tmux.conf.local .

Powerlevel10k

Next up is Powerlevel10k which allows very easy prompt adjustments and customisation from https://github.com/romkatv/powerlevel10k/tree/master

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

I have found it very helpful to include context to the prompt for remote servers and include the OS icon. Both of these are described well on the Powerlevel10k wiki (https://github.com/romkatv/powerlevel10k/blob/master/README.md#how-do-i-add-username-andor-hostname-to-prompt).

ZPlug

Finally we have zplug which allows ZSH plugin management easily from https://github.com/zplug/zplug. This, combined with the above .zshrc adjustments, makes for a great prompt experience.

curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh

Figurine (optional)

When switching between servers reguarly, I have recently been finding it very useful to see the name of the server in large type as soon as I login. To assist with this I am using figurine: https://github.com/arsham/figurine

I install figurine and then just add the following to the top of my .zshrc file.

echo ""
figurine -f "3d.flf" Server Name
echo ""