My ZSH Config
# Install base dependencies
sudo apt update
sudo apt install -y git zsh bat gpg
# Install eza
sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
sudo apt update
sudo apt install -y eza
# Ensure zsh is a valid login shell
grep -qxF '/usr/bin/zsh' /etc/shells || echo '/usr/bin/zsh' | sudo tee -a /etc/shells
mkdir -p "$HOME/.cache"
mkdir -p "$HOME/.config"
touch "$HOME/.cache/zshhistory"
# Clone and Install
git clone https://github.com/patrickdobler/zsh "$HOME/zsh-config"
cp -r "$HOME/zsh-config/.zshrc" "$HOME/.zshrc"
cp -r "$HOME/zsh-config/.config/zsh" "$HOME/.config/"
chsh -s /usr/bin/zsh# Install Ghostty
brew install --cask ghostty
brew install git eza bat
mkdir -p "$HOME/.cache"
mkdir -p "$HOME/.config"
touch "$HOME/.cache/zshhistory"
# Clone and Install
git clone https://github.com/patrickdobler/zsh "$HOME/zsh-config"
cp -r "$HOME/zsh-config/.zshrc" "$HOME/.zshrc"
cp -r "$HOME/zsh-config/.config/zsh" "$HOME/.config/"
chsh -s $(which zsh)
- git - required to clone this repo and auto-download plugins on first startup
- zsh-syntax-highlighting - auto-downloaded on first startup for syntax highlighting
- zsh-autosuggestions - auto-downloaded on first startup for history-based suggestions
- eza - modern replacement for the command-line program ls
- bat - interactive
catreplacement used without paging - homebrew-cask-upgrade - optional CLI for upgrading Homebrew casks (adds
brew cu) - Ghostty - optional terminal emulator used in the macOS setup above
On the first shell startup, the config clones zsh-autosuggestions and zsh-syntax-highlighting into ~/.config/zsh/plugins.
| Keys | Action |
|---|---|
| shift+tab | Accept autosuggest |
| home | Move to the beginning of the line. If already at the beginning of the line, move to the beginning of the previous line, if any. |
| end | Move to the end of the line. If already at the end of the line, move to the end of the next line, if any. |
| del | Delete the character under the cursor. |
| ctrl+→ | Move forward one word, vi-style. |
| ctrl+← | Move to the beginning of the previous word, vi-style. |
| ctrl+backspace | Kill the word behind the cursor, without going past the point where insert mode was last entered. |
| ctrl+del | Kill from the cursor to the end of the line. |
The prompt displays the current directory and Git branch information. The branch name is color-coded based on the repository state:
- Green: Clean repository.
- Yellow: Staged changes pending commit.
- Red: Unstaged changes or untracked files.
yaconfUpdate all AUR packages that have an update available.yacleanRemove uninstalled AUR packages and clean build files.yaclrRemove all cached AUR packages.yaupgUpdate all AUR packages to their latest versions.yasuUpdate all AUR packages to their latest versions without confirmation.yainInstall an AUR package.yainsUpgrade an installed AUR package.yareRemove an installed AUR package.yaremRemove an installed AUR package along with its dependencies and configuration files.yarepDisplay information about an AUR package.yarepsSearch for an AUR package.yalocDisplay information about an installed AUR package.yalocsSearch for an installed AUR package.yalstList all explicitly installed AUR packages.yaorphList orphaned AUR packages that are no longer required.yainsdInstall an AUR package as a dependency.yamirUpdate the package database and the AUR.yaupdUpdate the package database and the AUR.upgradeUpdate all packages to their latest versions.paclistList all explicitly installed AUR packages.
pacupgUpdate all packages to their latest versions.pacinInstall a package.pacleanRemove uninstalled packages and clean cache.pacinsUpgrade an installed package.paclrRemove all cached packages.pacreRemove an installed package.pacremRemove an installed package along with its dependencies and configuration files.pacrepDisplay information about a package.pacrepsSearch for a package.paclocDisplay information about an installed package.paclocsSearch for an installed package.pacinsdInstall a package as a dependency.pacmirUpdate the package database and the mirror list.paclsorphansList orphaned packages that are no longer required.pacrmorphansRemove all orphaned packages.pacfileupgUpdate the file list for all installed packages.pacfilesSearch for a file in the package database.paclsList all files installed by a package.pacownDetermine which package a file belongs to.pacupdUpdate the package database and the mirror list.upgradeUpdate all packages to their latest versions.pacmansignkeysImport and sign one or more PGP keys for use with pacman.pacmanallkeysRefresh all PGP keys used by pacman.pacupdateUpdate the mirror list using geoip.
ssh-startStart the SSH daemon.ssh-stopStop the SSH daemon.update-grubUpdate the GRUB bootloader configuration.
catIfbatis installed, the alias uses it as acatreplacement without paging.
showHiddenShow hidden files in the Finder.hideHiddenHide hidden files in the Finder.ooOpen the current directory in the Finder.
osupdateGet macOS software updates and update installed Homebrew and their installed packages.
ipShow the public IP address of the machine.localipShow the local IP address of the machine.dnsShow the DNS servers used by the machine.
lscleanupClean up LaunchServices to remove duplicates in the "Open With" menu.
dscleanRecursively delete.DS_Storefiles.drRead the "defaults" values.
brewaauto uninstalls formulae that are no longer needed.brewccleans the cache.brewCscrubs the cache, including downloads for the latest versions.brewdchecks your system for potential problems.breweedits given formula.brewfshows information about given formula.brewiinstalls given formula.brewllists installed formulae.brewLlists installed formulae that don't depend on other installed formula.brewolists outdated installed formulae.brewpremoves all cache files older than 30dbrewrreinstalls given formula.brewsperforms a search of formula names.brewSmanages background services with macOS' launchctl daemon manager.brewtlist installed packages with all dependenciesbrewuupdates Homebrew and all formulae.brewUupgrades outdated formulae.brewxuninstalls a given formula.brewXdeletes all installed versions of given formula.brewupupdates everything with Homebrewbrewcuupdates all casks including App Store apps (using homebrew-cask-upgrade)
caskeedits given cask.caskfshows information about given cask.caskiinstalls given cask.caskllists installed casks.caskolists outdated installed casks.caskrreinstalls given cask.casksperforms a search of cask tokens.caskUupgrades given cask or all outdated casks, if none given.caskxuninstalls given cask.caskXuninstalls even if given cask does not appear to be present.caskzzaps all files associated with given cask.
These aliases are shortcuts for the eza command, a modern replacement for ls.
lShow files and directories usingeza's default view.laShow almost all files and directories in long format with size, type, and human-readable format.lrShow files and directories sorted by date in long format with size, type, and human-readable format.ltShow files and directories sorted by date in long format with size, type, and human-readable format.llShow files and directories in long format with size, type, and human-readable format.ldotList dot files.loneShow files and directories in one line with indicators.lrtShow files and directories in one line with indicators in reverse order.lsrRecursive list of files and directories in long format with size, type, and human-readable format.lamcShow files and directories in long format with size, type, and human-readable format, and access, modified, and created date.llgShow files and directories in long format with size, type, and human-readable format in grid view.treeShow the directory structure in a tree format up to a depth of 2.treelShow files and directories in long format in a tree view up to a depth of 2.treelaShow almost all files and directories in long format with size, type, and human-readable format, including dot files, in a tree format up to a depth of 2.
If eza is not installed, these aliases are shortcuts for the ls command.
lShow files and directories with size, type, and human-readable format.laShow almost all files and directories in long format with size, type, and human-readable format.lrShow files and directories sorted by date in long format with size, type, and human-readable format.ltShow files and directories sorted by date in long format with size, type, and human-readable format.llShow files and directories in long format with size, type, and human-readable format.ldotList dot files.lSSort files and directories by size in a single column.lartSort files and directories by access time in a single column.lrtSort files and directories by modification time in a single column.lsrRecursive list of files and directories in long format with size, type, and human-readable format.lsnA column contains name of files and directories.treeShow the directory structure in a tree format up to any depth.
zshrcQuickly open the bootstrap~/.zshrcfile.
grepEnable colored output forgrep.sgrepRecursive search with line numbers and context for non-version control directories.
tShow the last few lines of a file and follow it as it updates.HShow the first few lines of output.TShow the last few lines of output.GFilter output with grep.LShow output inlesswith pagination.MShow output inmostwith pagination.LLShow all output inless.CAShow all output with non-printing characters.NEHide all error output.NULHide all output.PColorize Python traceback output.
dudShow the size of directories in the current directory.dufShow the size of files and directories in the current directory.dusShow the size of directories sorted by size in the current directory.fdFind directories with a specific name.ffFind files with a specific name.filecountShow the number of files in the current directory.
hShow the command history.hgrepSearch command history.helpShow the manual for a command.pShow information about running processes.sortnrSort in reverse numeric order.unexportRemove an environment variable.rm,cp,mvPrompt before overwriting or deleting files.mdCreate a directory and any necessary parent directories...,...Change the directory to the parent directory or grandparent directory.clsClear the terminal screen.topIf you have thehtopprocess monitoring tool installed on your system, the alias will overwritetopwithhtop
The extract function is a utility function that can extract files from a variety of compressed formats. To use the function, simply call it with the name of the compressed file(s) you want to extract, like so:
extract -v file1.tar.gz file2.zipThe gitpush function stages all changes, creates a commit with the message you pass in, and pushes the current branch.
The gitupdate function starts ssh-agent, adds ~/.ssh/github, and tests the connection to GitHub.
- https://github.com/Mach-OS/Machfiles/blob/master/zsh
- https://github.com/ChrisTitusTech/zsh
- https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/archlinux/archlinux.plugin.zsh
- https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/common-aliases/common-aliases.plugin.zsh
- https://github.com/zimfw/homebrew