Skip to content

Instantly share code, notes, and snippets.

@olafurpg
Last active June 6, 2020 12:39
Show Gist options
  • Save olafurpg/d8a6e9e3e6558731deaa3bf92c0c8848 to your computer and use it in GitHub Desktop.
Save olafurpg/d8a6e9e3e6558731deaa3bf92c0c8848 to your computer and use it in GitHub Desktop.
# cd without cd
setopt auto_cd
fpath=(~/.zsh/completion $fpath)
# Enable persistent history between shell sessions.
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory
setopt sharehistory
setopt incappendhistory
autoload -Uz compinit; compinit
# Highlight active tab completion.
zstyle ':completion:*' menu select
bindkey '^[[Z' reverse-menu-complete
# Search history when pressing up/down
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 "^[[A" up-line-or-beginning-search # Up
bindkey "^[[B" down-line-or-beginning-search # Down
# Delete up to last slash
autoload -U select-word-style
select-word-style bash
# Fuzzy tab completion matching
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
# brew install zsh-syntax-highlighting
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
[[ -s /Users/lgeirsson/.autojump/etc/profile.d/autojump.sh ]] && source /Users/lgeirsson/.autojump/etc/profile.d/autojump.sh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Use less when diffing with git
export GIT_PAGER=less git diff
export LESS=R
eval "$(starship init zsh)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment