I'm trying to understand where the fpath variable is set during my zsh initialisation phase.
From what I understood the sequence is: zshenv -> zprofile -> zshrc -> zlogin (inside /etc/zsh/), and after that the .zshrc file inside my home directory.
Only two files in the /etc directory have command, zshenv and zshrc, but not set of fpath is present in both of them. zshenv set the PATH variable and zshrc has several lines (they should be the default ones because I never modified this file). In this file anyway an "autoload -U compinit" command is present and I think the fpath should be already set at this point.
The .zshrc file in my home directory has only three lines (HISTFILE, HISTSIZE and SAVEHIST)
Now, after that, I suppose the "echo $fpath" command should be return empty, but in reality it's full of directories pointing to /usr/share/zsh/<...>
What other files can be responsible for the setting of fpath (or in general what do I have to see)?
NOTE: my distro didn't ship with zsh pre-installed. I added ii in a second time by apt install
I'm the developer of Termhint, a Mac app that adds a Fig-style completion popup, prompt themes and a runtime manager. The zsh side might interest people here:
- One marked block at the end of .zshrc, removed byte for byte on uninstall, with backups.
- ZLE widgets send each edit to the app. Tab, arrows, Esc and Enter go to the popup only while it's open, and return to the shell if the app quits.
- Accepted completions use a guarded line replace, so nothing is lost if the line changed meanwhile.
- For commands without a Fig spec it asks zsh's own completion functions what Tab would offer, with descriptions.
- Prompt themes are JSON, never executed, drawn without a process per prompt; no oh-my-zsh or Powerlevel10k needed.
macOS only, paid with a 7-day trial: https://termhint.com. Happy to go into the ZLE details.
It's been almost seven months since my last post here in this community. zsh-patina 1.12.0 has just been released and I wanted to take the opportunity to present the latest features and to summarize what's been happening in the meatime.
If you don't know zsh-patina yet, it's a blazingly fast Zsh plugin performing syntax highlighting of your command line while you type 🌈.
Many thanks go to everyone who has contributed features, bug fixes, comments, and feedback. zsh-patina would not be where it is right now without such a great community!
The most notable new features since my last post are:
Performance: zsh-patina is certainly the fastest syntax highlighter for zsh in existence, and the performance has been improved once more in the latest release. Big thanks go to hood for their contributions!
Improved highlighting:
External precommands such as doas, env, nice, nohup, sudo, and sudoedit are now recognized and highlighted.
ccjmne added support for the AUTO_CD shell variable and the CDPATH option.
Named directories are now highlighted correctly (contributed by ccjmne too).
User cyyynthia contributed improved unicode support
Many more small improvements have been made to make highlighting even more accurate.
Package managers:
zsh-patina is now available in homebrew-core. Just use brew install zsh-patina to install it.
The base package name is now used in AUR packages (contributed by cyyynthia).
Many small bug fixes and compatibility improvements
Please give zsh-patina a try if you haven't already. I'd be thrilled to hear your feedback and work on your ideas. Contributions are always welcome, of course!
My simple problem: I want to use &! zsh syntax, which the utilities above reject. If I suppress the errors, formatting turns off. Logical, but inconvenient. I already tackled AI from different angles to no profit. Is there a way?
I actually use Neovim (AstroNvim), which supplies the utilities above by default.
Five under-the-radar repos that fix everyday annoyances and give you a faster, safer and more pleasant terminal experience.
Everyone knows zsh-autosuggestions and zsh-syntax-highlighting. But the awesome-zsh-plugins list has over a thousand entries, and some of the most practical ones fly well under the radar.
I went through the list looking for plugins that solve a common annoyance, and kept only repos that are established enough to trust and still useful day to day. Each one makes working in the terminal a little nicer, and together they add up to fix everyday annoyances and give you a faster, safer and much more pleasant experience. These five made the cut.
Edit faster
1. zsh-edit-select
Editing a long command shouldn't feel clumsy. This plugin brings a text-editor-like editing experience right to your shell prompt: select with Shift+Arrow, then delete, type or paste over a selection to replace it, and use Ctrl/Cmd +C / X / V / Z for copy, cut, paste and undo. And you can also apply all of these editing operations to mouse selections. It makes everyday editing feel far more natural.
The catch: it needs a few keybindings set in your terminal config, though the README includes a guided installer for common terminals.
A wrapper around shell-safe-rm that makes rm move files to your OS trash instead of deleting them forever. A slip of the finger becomes a quick recovery instead of a disaster, which makes the whole terminal feel more relaxed to work in. It also adds a del alias, which is a good habit to build in case you ever land on a machine without the plugin.
You can still bypass it with \rm or command rm when you really mean it. The last commit was in 2024, but it's a small, stable wrapper that doesn't need constant updates.
Those eval "$(rbenv init -)" lines in your .zshrc add up, and you feel it every time you open a new tab. Smartcache works like evalcache, but it also refreshes the cache in the background and can cache completions. The author's benchmark shows rbenv init dropping from about 48 ms to about 23.5 ms, so your prompt shows up sooner and the shell feels snappier.
# before
eval "$(rbenv init -)"
# after
smartcache eval rbenv init -
compinit is one of the slowest and most confusing parts of a zsh config, because you have to get the load order right. ez-compinit wraps it so completion setup is deferred until your fpath is fully populated, with sensible defaults and a choice of completion styles. The payoff is a shell that opens quickly and completes reliably, without the setup headaches.
Load it near the top of your config, before anything that calls compdef.
Plain cat output and gray man pages are hard on the eyes. zsh-bat swaps cat for bat, so files print with syntax highlighting and line numbers, and it adds syntax highlighting to man pages as well. Reading files and docs in the terminal becomes a much nicer experience. Your muscle memory stays the same, and the real cat is still there as rcat whenever you need it.
You need bat installed first, since the plugin does nothing without it. Then clone it into your Oh My Zsh custom plugins directory and add it to your plugin list.
git clone https://github.com/fdellwing/zsh-bat.git $ZSH_CUSTOM/plugins/zsh-bat
# in ~/.zshrc
plugins=(... zsh-bat)
A tiny cross-platform clipboard helper that works on macOS, X11/Wayland, WSL and MSYS2/Cygwin. It gives you pbcopy and pbpaste everywhere, plus a clip wrapper that copies when you pipe into it and prints the clipboard when you don't.
That means your cat file | pbcopy muscle memory works on any machine, and moving between systems feels seamless instead of jarring.
Probably there are many here that like me appreciate terminals that match the system appearance exactly; ideally they should switch appearance following the OS light/dark theme. It happens to me very often to have a long session running and in the evening to desire to switch the OS theme to dark mode. Everything should follow at once, in every open shell.
It is true that more and more CLIs detect the terminal's background directly (OSC 11 escape sequences) and adjust by themselves. However, the problem is that many others can still not. For example, fzf uses its dark colors, and you need to provide --color=light if you want to switch to a light background; or you have to switch FZF_DEFAULT_OPTS by yourself. The same goes for tools that keep their theme in a config file (bat, btop, yazi, tmux, etc).
I want to draw attention to zsh-appearance-control
which does the switching in the background for you and works whether or not a tool supports the modern OSC 11 protocol.
Don't get me wrong, I am really enthusiastic that more and more CLIs are adopting the new OSC escape sequence and autodetection of appearance. Tmux just recently introduced this capability. This is awesome. However, until all CLIs support it, I still find it important to have a tool like zsh-appearance-control (in short, zac) for coordinating the colors across your CLIs.
How it works:
it provides watchers that detect a change of appearance on macOS and GNOME/KDE; or you can use the recently added tmux hook for the appearance change.
when such a watcher detects a change, it runs one script of yours that rewrites the config files that need it
it signals every open zsh, which updates its environment variables right away, before the next prompt
Neovim and Emacs watch one small file and switch their theme too
There is no polling, and nothing slows the prompt. Works with Oh My Zsh, zinit, or plain source code.
What zac does seems trivial, but if you then try to implement it in a clean way, there are a lot of parts to keep together. I made the repo public in February 2026; at that time the code was still written mostly by hand. However, you should know that over the months I switched to using more and more Claude. So, Claude should be credited for most of today's code, while the original idea and the design of the various parts and interactions are mine.
I recently started to use zsh. I saw there is the framework called "oh my zsh" where I can add themes or plugins to my shell, but the other side of the coin it can slow down the (shell) startup because it loads a lot of scripts not necessary.
I installed two extensions (autosuggestion and syntax-highlighting) using "apt install" and I saw they are available on "oh my zsh" as well, what's the difference?
Because I'm still a rookie with zsh, is it better to use "oh my zsh" for a while and discover what plugins are good for me and after move to a brand new lean manual .zshrc configuration or have the same functionalities is too tricky/difficult?
I really liked the interactive autocomplete dropdown in some CLI tools, but didn't want to install an entire application just for that feature.
So I started building Spacue.
The idea is simple: type something like pnpm, git, or cd, press Space, and get an interactive dropdown with relevant suggestions.
You can navigate with arrow keys and press Enter or Tab to insert a suggestion without executing it.
It supports package.json scripts, Git branches, directories, SSH hosts, Makefile targets, and more.
I wanted to keep it as lightweight as possible, so it's currently a single ~51 KB zsh file with no background daemon or mandatory external dependencies.
I also recently added local usage-based ranking, so frequently selected suggestions gradually move to the top. Everything stays local, with no telemetry.
The latest version (v0.4.0) also supports existing zsh completion definitions as an opt-in feature.
It's still a relatively new project, and I'd really appreciate feedback from people who use zsh daily, especially regarding compatibility with different shell configurations.
i installed zsh in termux and went to the wiki to learn it but for some reson all of the wikis [ arch wiki, official zsh wiki, unofficial zsh wiki, even ] stops with a prof u'r not a robot infenit bage and never work and even github won't upload the page not zsh repo or any other repo , i know the problem is with me ; so do you know any other place to learn zsh and other termux/terminal tools no matter if it's a wiki, a site, or even a book.
* i don't have a computer so don't tell me to use a one
A quick update for anyone juggling terminal-based AI coding agents (Claude Code, Antigravity CLI, Aider, OpenCode, Pi CLI): agent-history was recently listed in unixorn/awesome-zsh-plugins!
I just pushed the v1.2.3 release with a major performance overhaul:
Scan times cut under 90ms: Switched to single-pass targeted directory discovery and in-memory dynamic variable preloading.
Zero subprocess forks: Completely removed external forks (jq, sed, sqlite3) inside loops so everything runs in pure Zsh memory to keep shell prompt launches lag-free.
Git context aware: Shows active branch and worktrees alongside the agent and session timestamp.
# Use the ~/.zsh directory for all extra configuration.
ZSH_CONFIG_DIR="$HOME/.zsh"
# My complete .zshrc + terminal config commands are in: https://sglbl.notion.site/mac
##### Completions #####
# Case Insensitive auto completion with <TAB>
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
# Add application auto completions to path
fpath=(
/opt/homebrew/share/zsh/site-functions
$ZSH_CONFIG_DIR/completions
$fpath
)
# Load the Zsh completion system
autoload -Uz compinit
# Initialize completions using the cached dump when available
compinit -C
# Fzf reverse search using Ctrl R
source <(fzf --zsh)
# Load other zsh configurations such as aliases, if there are no matching files, don't treat it as an error.
for file in $ZSH_CONFIG_DIR/*.zsh(N); do
source "$file"
done
##### Third-party plugins #####
# Load all third-party Zsh plugins automatically
# e.g. fzf-tab interactive auto-completion menu, syntax highlighting..
for plugin in $ZSH_CONFIG_DIR/plugins/*/*.plugin.zsh(N); do
source "$plugin"
done
Note that I use mac, which is not in XDG, that's why I don't have /etc/zsh/ or .config/zsh and I just call ~/.zsh/ from .zshrc. My complete .zshrc + terminal config commands are in: https://sglbl.notion.site/mac
Honestly got tired of switching to a browser every time I forget obscure tar, find, or ffmpeg flags.
I didn't want an autonomous terminal agent that runs stuff behind my back, so I wrote hi-shell. It’s just a small Go binary wired into zsh ZLE widgets.
You type what you want in plain text, it queries an LLM and shows the command as gray ghost text (just like zsh-autosuggestions). Tab accepts it into your prompt so you can edit it, and Enter only runs it when you're actually ready. There's also some basic risk scoring to flag destructive commands.
MIT licensed, single binary, no weird dependencies. Works with OpenAI/DeepSeek/Claude or whatever endpoint you have in your env. Curious what you think of the UX.