Skip to content

Instantly share code, notes, and snippets.

Last active January 2, 2024 15:47
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mattmc3/c490d01751d6eb80aa541711ab1d54b1 to your computer and use it in GitHub Desktop.
Save mattmc3/c490d01751d6eb80aa541711ab1d54b1 to your computer and use it in GitHub Desktop.
ZSH - options by framework
## ZSH Options
# Changing Directories
setopt auto_cd # if a command isn't valid, but is a directory, cd to that dir
setopt auto_pushd # make cd push the old directory onto the directory stack
setopt pushd_ignore_dups # don’t push multiple copies of the same directory onto the directory stack
setopt pushd_minus # exchanges the meanings of ‘+’ and ‘-’ when specifying a directory in the stack
# Completions
setopt always_to_end # move cursor to the end of a completed word
setopt auto_list # automatically list choices on ambiguous completion
setopt auto_menu # show completion menu on a successive tab press
setopt auto_param_slash # if completed parameter is a directory, add a trailing slash
setopt complete_in_word # complete from both ends of a word
unsetopt menu_complete # don't autoselect the first completion entry
# Expansion and Globbing
setopt extended_glob # use more awesome globbing features
setopt glob_dots # include dotfiles when globbing
# History
setopt append_history # append to history file
setopt extended_history # write the history file in the ':start:elapsed;command' format
unsetopt hist_beep # don't beep when attempting to access a missing history entry
setopt hist_expire_dups_first # expire a duplicate event first when trimming history
setopt hist_find_no_dups # don't display a previously found event
setopt hist_ignore_all_dups # delete an old recorded event if a new event is a duplicate
setopt hist_ignore_dups # don't record an event that was just recorded again
setopt hist_ignore_space # don't record an event starting with a space
setopt hist_no_store # don't store history commands
setopt hist_reduce_blanks # remove superfluous blanks from each command line being added to the history list
setopt hist_save_no_dups # don't write a duplicate event to the history file
setopt hist_verify # don't execute immediately upon history expansion
setopt inc_append_history # write to the history file immediately, not when the shell exits
unsetopt share_history # don't share history between all sessions
# Initialization
# Input/Output
unsetopt clobber # must use >| to truncate existing files
unsetopt correct # don't try to correct the spelling of commands
unsetopt correct_all # don't try to correct the spelling of all arguments in a line
unsetopt flow_control # disable start/stop characters in shell editor
setopt interactive_comments # enable comments in interactive shell
unsetopt mail_warning # don't print a warning message if a mail file has been accessed
setopt path_dirs # perform path search even on command names with slashes
setopt rc_quotes # allow 'Henry''s Garage' instead of 'Henry'\''s Garage'
unsetopt rm_star_silent # ask for confirmation for `rm *' or `rm path/*'
# Job Control
setopt auto_resume # attempt to resume existing job before creating a new process
unsetopt bg_nice # don't run all background jobs at a lower priority
unsetopt check_jobs # don't report on jobs when shell exit
unsetopt hup # don't kill jobs on shell exit
setopt long_list_jobs # list jobs in the long format by default
setopt notify # report status of background jobs immediately
# Prompting
setopt prompt_subst # expand parameters in prompt variables
# Scripts and Functions
# Shell Emulation
# Shell State
# Zle
unsetopt beep # be quiet!
setopt combining_chars # combine zero-length punctuation characters (accents) with the base character
setopt emacs # use emacs keybindings in the shell

zsh set -o to see which options are set per each zsh framework

zsh options reference

zsh option category default oh-my-zsh prezto
noaliases Input/Output
aliasfuncdef Scripts and Functions
allexport Initialization
noalwayslastprompt Completion
alwaystoend Completion
appendcreate Shell Emulation
noappendhistory History
autocd Changing Directories
autocontinue Job Control
noautolist Completion
noautomenu Completion
autonamedirs Completion
noautoparamkeys Completion
noautoparamslash Completion
autopushd Changing Directories
noautoremoveslash Completion
autoresume Job Control
nobadpattern Expansion and Globbing
nobanghist History
nobareglobqual Expansion and Globbing
bashautolist Completion
bashrematch Shell Emulation
nobeep Zle
nobgnice Job Control
braceccl Expansion and Globbing
bsdecho Shell Emulation
nocaseglob Expansion and Globbing
nocasematch Expansion and Globbing
cbases Scripts and Functions
cdablevars Changing Directories
chasedots Changing Directories
chaselinks Changing Directories
nocheckjobs Job Control
nocheckrunningjobs Job Control
noclobber Input/Output
combiningchars Zle
completealiases Completion
completeinword Completion
continueonerror Shell Emulation
correct Input/Output
correctall Input/Output
cprecedences Scripts and Functions
cshjunkiehistory Shell Emulation
cshjunkieloops Shell Emulation
cshjunkiequotes Shell Emulation
cshnullcmd Shell Emulation
cshnullglob Expansion and Globbing
nodebugbeforecmd Scripts and Functions
dvorak Input/Output
emacs Zle
noequals Expansion and Globbing
errexit Scripts and Functions
errreturn Scripts and Functions
noevallineno Scripts and Functions
noexec Scripts and Functions
extendedglob Expansion and Globbing
extendedhistory History
noflowcontrol Input/Output
forcefloat Expansion and Globbing
nofunctionargzero Scripts and Functions
noglob Expansion and Globbing
noglobalexport Initialization
noglobalrcs Initialization
globassign Expansion and Globbing
globcomplete Completion
globdots Expansion and Globbing
globstarshort Expansion and Globbing
globsubst Expansion and Globbing
nohashcmds Input/Output
nohashdirs Input/Output
hashexecutablesonly Input/Output
nohashlistall Completion
histallowclobber History
nohistbeep History
histexpiredupsfirst History
histfcntllock History
histfindnodups History
histignorealldups History
histignoredups History
histignorespace History
histlexwords History
histnofunctions History
histnostore History
histreduceblanks History
nohistsavebycopy History
histsavenodups History
histsubstpattern Expansion and Globbing
histverify History
nohup Job Control
ignorebraces Expansion and Globbing
ignoreclosebraces Expansion and Globbing
ignoreeof Input/Output
incappendhistory History
incappendhistorytime History
interactive Shell State
interactivecomments Input/Output
ksharrays Shell Emulation
kshautoload Shell Emulation
kshglob Expansion and Globbing
kshoptionprint Shell Emulation
kshtypeset Shell Emulation
kshzerosubscript Shell Emulation
nolistambiguous Completion
nolistbeep Completion
listpacked Completion
listrowsfirst Completion
nolisttypes Completion
localloops Scripts and Functions
localoptions Scripts and Functions
localpatterns Scripts and Functions
localtraps Scripts and Functions
login Shell State
longlistjobs Job Control
magicequalsubst Expansion and Globbing
mailwarning Input/Output
markdirs Expansion and Globbing
menucomplete Completion
monitor Job Control
nomultibyte Expansion and Globbing
nomultifuncdef Scripts and Functions
nomultios Scripts and Functions
nonomatch Expansion and Globbing
nonotify Job Control
nullglob Expansion and Globbing
numericglobsort Expansion and Globbing
octalzeroes Scripts and Functions
overstrike Zle
pathdirs Input/Output
pathscript Input/Output
pipefail Scripts and Functions
posixaliases Shell Emulation
posixargzero Shell Emulation
posixbuiltins Shell Emulation
posixcd Changing Directories
posixidentifiers Shell Emulation
posixjobs Job Control
posixstrings Shell Emulation
posixtraps Shell Emulation
printeightbit Input/Output
printexitvalue Input/Output
privileged Shell State
promptbang Prompting
nopromptcr Prompting
nopromptpercent Prompting
nopromptsp Prompting
promptsubst PromptingPrompting
pushdignoredups Changing Directories
pushdminus Changing Directories
pushdsilent Changing Directories
pushdtohome Changing Directories
rcexpandparam Expansion and Globbing
rcquotes Input/Output
norcs Initialization
recexact Completion
rematchpcre Expansion and Globbing
restricted Shell State
rmstarsilent Input/OutPromptingut
rmstarwait Input/Output
sharehistory History
shfileexpansion Shell Emulation
shglob Expansion and Globbing
shinstdin Shell State
shnullcmd Shell Emulation
shoptionletters Shell Emulation
noshortloops Input/Output
shwordsplit Shell Emulation
singlecommand Shell State
singlelinezle Zle
sourcetrace Scripts and Functions
sunkeyboardhack Input/Output
transientrprompt Prompting
trapsasync Shell Emulation
typesetsilent Scripts and Functions
nounset Expansion and Globbing
verbose Scripts and Functions
vi Zle
warncreateglobal Expansion and Globbing
warnnestedvar Expansion and Globbing
xtrace Scripts and Functions
zle Zle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment