knoebber / zshrc

~/.zshrc Commits Diff Raw
# 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"

source /opt/homebrew/opt/powerlevel10k/powerlevel10k.zsh-theme

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

# ZSH completions, dependent on brew package being installed
if type brew &>/dev/null; then
  FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
  autoload -Uz compinit

# Set vi keybindings
bindkey -v

# History
export HISTFILE=~/.zsh_history
export HISTFILESIZE=100000
export HISTSIZE=100000

setopt extended_history
setopt hist_find_no_dups
setopt hist_ignore_all_dups
setopt hist_ignore_dups
setopt share_history
setopt autopushd
setopt pushdignoredups

# Enable C-R searching (make sure this appears after bindkey -v)
bindkey '^R' history-incremental-search-backward

# Aliases
alias ls='exa'
alias hist='history 1' # Show all history
alias d='dirs -v' # Show directory history (relies on autopushd, use pushd +<number> to restore)

export EDITOR='vim'
export ERL_AFLAGS="-kernel shell_history enabled" # Save history in iex
export PATH="$PATH:/Users/nicolasknoebber/go/bin"
export PATH="$PATH:/Users/nicolasknoebber/bin"