Skip to content

Instantly share code, notes, and snippets.

@mslw
Last active November 29, 2022 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mslw/926f1191e61ef2d705fadab66d19b8ba to your computer and use it in GitHub Desktop.
Save mslw/926f1191e61ef2d705fadab66d19b8ba to your computer and use it in GitHub Desktop.
A fairly minimal .zshrc file, with https://github.com/sindresorhus/pure prompt. Patchworked from my personal config, autogenerated bits, and some snippets. Made for setting up zsh on JupyterHub.
# Set up the prompt
fpath+=($HOME/.zsh/pure)
autoload -Uz promptinit
promptinit
prompt pure
setopt histignorealldups sharehistory
# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history
# set LS_COLORS
eval `dircolors -b`
alias diff='diff --color=auto'
alias grep='grep --color=auto'
alias ls='ls --color=auto'
# Use modern completion system
autoload -Uz compinit
compinit
setopt extendedglob
zstyle ':completion:*' completer _complete _ignored
zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[._-]=* r:|=*' 'l:|=* r:|=*'
# Show tab-completion menu, with colors
zstyle ':completion:*' menu select
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
# Up arrow search
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "$key[Up]" up-line-or-beginning-search # Up
bindkey "$key[Down]" down-line-or-beginning-search # Down
# allow games (cowsay)
path+=('/usr/games/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment