Skip to content

Instantly share code, notes, and snippets.

@justingoeres
Last active August 18, 2022 16:13
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 justingoeres/644f91cf5cab6eeb10dfb22b1368429c to your computer and use it in GitHub Desktop.
Save justingoeres/644f91cf5cab6eeb10dfb22b1368429c to your computer and use it in GitHub Desktop.
Justin's .zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Install casks under ~/Applications
export HOMEBREW_CASK_OPTS="--appdir=~/Applications"
# Load aliases
ALIASES=$HOME/.aliases
if [ -f "$ALIASES" ]; then
source $ALIASES
fi
# Load antigen for zsh plugin management
source /opt/homebrew/share/antigen/antigen.zsh
# Use antigen to load stuff
## Use oh-my-zsh
antigen use oh-my-zsh
## Add plugins
antigen bundles << EOBUNDLES
aliases # 'acs' show all zsh-plugin aliases by group
ant # caches ant targets in .ant_targets
# brew # brew command aliases
common-aliases # helpful shortcut aliases for common commands (e.g. 'll' -> 'ls -lFh')
copybuffer # ctrl+o to copy current command line text to clipboard
copypath # copy absolute path of current dir or target to clipboard
dircycle # ctrl+shift+left_or_right to move back & forth in directory history
docker # autocompletion & aliases for docker
dotenv # load environment variables from .env when cd'ing to a directory
emoji # maps emoji to shell variables
emotty # returns an emoji for the current $TTY number so it can be used in a prompt
thefuck # say fuck to fix previous command
git # a whole ton of git aliases
gitignore # generate gitignore.io templates in the shell
jsontools # pretty-print json with pp_json; validate with is_json
macos # command shortcuts for e.g. Finder, Preview; btrestart to restart bluetooth
magic-enter # execute commands when just hitting Enter
safe-paste # stops pasted commands from immediately running
sublime # shortcuts for Sublime Text
sudo # esc-esc to repeat last command but w/ sudo
systemadmin # aliases & functions to make sysadmin life easier
zsh-users/zsh-autosuggestions # suggest completions from shell history
zsh-users/zsh-syntax-highlighting # install syntax highlighting (must be last bundle in list)
EOBUNDLES
## Set theme
#antigen theme robbyrussell
#antigen theme agnoster
antigen theme romkatv/powerlevel10k
# Commit it!
antigen apply
# Bind 'copypath' to Ctrl+O Ctrl+O
bindkey -M emacs -s '^O^O' 'copypath^M'
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment