Do yourself a favor and try to configure your shell without ohmyzsh first. You’d be surprised at how few plugins actually require it, and you save yourself from horrible performance.
I used ohmyzsh with powerlevel10k/powerlevel10k[0] for years though recently i've settled on fish [1]<p>[0] <a href="https://github.com/romkatv/powerlevel10k">https://github.com/romkatv/powerlevel10k</a>
[1] <a href="https://fishshell.com/" rel="nofollow">https://fishshell.com/</a>
I never understood how omz was useful.<p>Zsh already has a module system (autoload), a prompt framework (promptinit), and Git integration
(vcs_info) builtin.<p>I have a pretty extensive Zsh setup in vanilla Zsh: <a href="https://github.com/cbarrick/dotfiles">https://github.com/cbarrick/dotfiles</a>
Recently, I moved off from oh-my-zsh after many users, to vanilla zsh with <a href="https://starship.rs" rel="nofollow">https://starship.rs</a>, mainly due to the loading speed (used <a href="https://github.com/romkatv/zsh-bench">https://github.com/romkatv/zsh-bench</a> to measure the speed).<p>Still wanting to try out fish and hopefully soon!
The defaults it ships out of the box makes the shell actually usable. Unsure I could ever go back to a regular bash/zsh prompt.<p>A lot of people will tell you this is slow and you've got to use X,Y,Z instead. If you're new, I'd strongly recommend just sticking with this, it's much easier to configure.
The following goes a long way:<p><pre><code> setopt PROMPT_SUBST
HISTFILE=~/.zsh_history
HISTSIZE=100000
SAVEHIST=100000
PROMPT='%B%(?..%F{red}%?%f )%F{blue}%~ %F{green}%#%f%b '
RPROMPT='%B%F{red}$(git branch --show-current 2> /dev/null)%f%b'
</code></pre>
And if you want autosuggestions:<p><pre><code> brew install zsh-autosuggestions
</code></pre>
Then add the following to your ~/.zshrc:<p><pre><code> source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh</code></pre>
PSA: simply installing this won't get you many benefits until you read about what it can do and then make an effort to use those things in your workflow.
Zsh autosuggestions
Zsh syntax highlighting
Fzf-tab<p>Paired with zoxide and fzf for the zsh keyboard shortcuts are all I need to be very productive.<p>Starship.rs is very useful as well as a theme but pure and pl10k are also great.
I use and like omyzsh, but find it super annoying how it deals with updating. It either nags you constantly to update, or if you set it to "auto," then it's constantly spamming you about how it's updating, and when you create a new shell session (say, in tmux), it causes significant lag before you can use the new shell and pollutes the console with tons of output. There has to be a better way, like some optional mode that just runs an update service in 3am silently using systemd.
For comparison, here is my Zsh configuration in NixOS:<p><pre><code> {
programs.starship = {
enable = true;
};
programs.zsh = {
enable = true;
enableCompletion = true;
enableBashCompletion = true;
enableGlobalCompInit = true;
syntaxHighlighting.enable = true;
syntaxHighlighting.highlighters = [ "main" "brackets" ];
histSize = 100000;
# See `man zshoptions` for more details.
setOptions = [
# Remove duplicates continuously from command history (preserve newest entry).
"HIST_IGNORE_DUPS"
# Instantly share command history between all active shells.
"SHARE_HISTORY" # Alternative to: "APPEND_HISTORY", "INC_APPEND_HISTORY",
# Disable ^S and ^Z for less accidental freezing.
"FLOW_CONTROL"
# Save timestamp and duration of each command in command history.
"EXTENDED_HISTORY"
];
shellAliases = {
rm = "rm -iv";
ls = "ls -F --color=auto";
gs = "git status";
gd = "git diff";
gdc = "git diff --cached";
gap = "git add -p";
gl = "git log";
gpr = "git pull --rebase";
};
interactiveShellInit = ''
bindkey '^[[7~' beginning-of-line
bindkey '^[[8~' end-of-line
bindkey '^R' history-incremental-search-backward
eval "$(starship init zsh)"
'';
};
}
</code></pre>
My .zshrc used to be bigger, but I've slimmed it down to see what I actually use from it.
Zprezto is a good alternative which is also faster. I eventually migrated to zim because of its minimalist approach.<p>I think starting from Oh My Zsh or zprezto can be a good choice. Once you get a feel of what zsh can accomplish, eventually probably you’ll one day find it too slow and/or too complicated and then would switch to something like zim to only load the things you know is useful from then.
Do yourself a favour and install fish-shell with starship.rs and call it a day. Make sure to put everything prompt related in a `if status --is-interactive` block. Blazing fast versatile fancy prompt and interactive human friendly shell. What does a man need more?
I followed this advice and my shell went from 1530ms to 35ms startup time.<p>Main culprits were language switchers (nvm, jabba, pyenv). Which I moved to lazy loading.<p>If I drop the ohmyzsh plugins startup time is 11ms. But, I want some quality of life.<p>There's a nice benchmarking command in the article if you want to test yours:<p>for i in $(seq 1 10); do /usr/bin/time $SHELL -i -c exit; done
I prefer sheldon[1] for the few plugins I use<p>[1] <a href="https://github.com/rossmacarthur/sheldon">https://github.com/rossmacarthur/sheldon</a>
I use omz primarily with the Kubernetes addons - which are now integral to my existence.<p>Does fish support something similar? If so then I could be encouraged to give it a whirl.
zsh autosuggestions has been pretty slow for me compared to fish out of the box, switched a year or so back and have been pretty happy. maybe something has changed now :thinking-emoji:<p>oh-my-fish is pretty much similar in capabilities and has a good assortment of themes.<p>All I used that came with zsh were git shortcuts like gc -m "comment", gst for git status which i just recreated in my fish config.
These days I stick to a minimal profile for the default shell (zsh on macOS and bash on Linux), adding no further than some aliases. When I need more “friendly” interactive features I launch fish which is… friendly and interactive, and exit when I’m done. Thus I get the best of both worlds.
I'm a developer of 10 years, and use the command line for Git, Brew and a few other things, though I'm normally an IDE developer. I believe the CL is as powerful as everyone says, but what are some useful things I can use it for? I use Zsh on a Mac some of the time.
I would actually recommend using fish with budspencer theme which is really great
<a href="https://github.com/oh-my-fish/theme-budspencer">https://github.com/oh-my-fish/theme-budspencer</a>
Loading time is not an issue for me. I run tmux so my sessions stay alive and performance is very quick. M2 MacBook Air with 16GB RAM, using Warp terminal. Using OMZ with Dracula Theme and mosh for remote servers.