Zsh Commands
The following is a guide to the commands and aliases available after configuring your system with the Quiet Mind macOS Bootstrap.
Fuzzy Finder
fzf is an interactive filter program for any kind of list; files, command history, processes, hostnames, bookmarks, git commits, etc. It implements a "fuzzy" matching algorithm, so you can quickly type in patterns with omitted characters and still get the results you want.
Tto quit interactive modes you can use any of the following keyboard shortcuts:
- Escape
- CTRL + C
- CTRL + Q
Built-in Shell Integrations
- CTRL + R: fuzzy search shell history
- CTRL + T: fuzzy-insert a file path into the current command
- OPTION + C: fuzzy
cdinto a subdirectory
Note: To enable OPTION + C you'll need to set "Left option key" to "ESC+" under Settings > Profiles > Keys in iTerm.
Usage
Pipe the contents of a file to perform a fuzzy search of its contents:
bashcat readme.md | fzf
Show a file browser with file content previews to the right side of the terminal:
You can pipe the output from other commands tobashfzf --style full --preview 'fzf-preview.sh {}' --bind 'focus:transform-header:file --brief {}'
fzf as needed.
bashfd --type f --hidden --no-ignore | fzf | xargs open
Zoxide
zoxide is a smarter cd command. It remembers which directories you use most frequently, so you can "jump" to them in just a few keystrokes.
z <directory>zi(usecontrol-cto quit)
Aliases and Custom Functions
General
search: recursively search current directory, select a match with fuzzy search, and open it in nvimlivesearch: recursively perform a live search on the current directorycl: clear the terminal outputcdc: change to the home directory and clear the terminal outputmkcd: make a new directory and change into the newly created directoryechopath: print out the paths in $PATH each on a new linelc: copy the most recently run command to the clipboard
Git
pdev: check out thedevbranch and pull the latest changes from the remotepmain: check out themainbranch and pull the latest changes from the remotebrclear: nuke all local branches except current, master, main, devbrsync: delete local branches whose remote tracking branch no longer existsgco: use fuzzy search to checkout a branchstash: stash your current changes, including any untracked fileslogdiff: show the full patch diff for every commit in the loggitstats: shortcut to rungit-quick-statslg: shortcut to runlazygit
Sync Repo
Thesyncrepo command runs git pull, git add, git commit, and git push.
The command uses cfg (my dotfiles bare repo git command) instead of git when run in the home directory.
Developer Tools
json: maps tojqyaml: maps toyq
Network
flushdns: flush the DNS cache and restart the DNS responder servicelocalip: show the local IP address
Zsh
reload: reload zshtimezsh: benchmark zsh startup time
Add default flags to system commands
df: becomesdf -hwhich outputs file system space usage in human-readable sizes in the power of 1024 (e.g. 1023M)du: becomesdu -chwhich outputs a total disk usage in human-readable sizes in the power of 1024 (e.g. 1023M)grep: becomesgrep --color=autowhich colorizes the output when stdout is a TTYfgrep: becomesfgrep --color=autowhich colorizes the output when stdout is a TTYegrep: becomesegrep --color=autowhich colorizes the output when stdout is a TTYdiff: becomesdiff --color=autowhich colorizes the output when stdout is a TTYrg: becomesrg --smart-casewhich matches case-insensitively unless the pattern contains an uppercase letter, in which case it matches case-sensitively
Phoenix Window Manager
cdphoenix: change to the~/.config/phoenix/directorylogphoenix: change to the~/.config/phoenix/directory and tail the log file