-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
48 lines (40 loc) · 1.72 KB
/
zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 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
function source_if_exists() { [ -f "$1" ] && source "$1" }
# From brew --prefix
BREW_PREFIX="/opt/homebrew"
export DOTFILES_DIR="$HOME/.dotfiles"
export ZPLUG_HOME="$BREW_PREFIX/opt/zplug"
source_if_exists $ZPLUG_HOME/init.zsh
if [ $(command -v zplug) ]; then
# Add automatic colors to iterm tabs based on current directory
zplug "$DOTFILES_DIR/zsh/iterm-fast-tabcolor/", from:local
# Add Fish-like syntax highlighting
zplug "zdharma-continuum/fast-syntax-highlighting", defer:2
# Add Fish-like autosuggestions for zsh
zplug "zsh-users/zsh-autosuggestions"
# Add `z` command to jump to frequently used directories
zplug plugins/z, from:oh-my-zsh
# Auto-completion
zplug plugins/brew, from:oh-my-zsh
zplug plugins/docker, from:oh-my-zsh
zplug plugins/gitfast, from:oh-my-zsh
zplug load
fi
# Completion
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
fpath=($BREW_PREFIX/share/zsh/site-functions $fpath)
fpath=($HOME/.zsh/completion $fpath)
autoload -Uz compinit
compinit
source_if_exists "$DOTFILES_DIR/zsh/options.zsh"
source_if_exists "$DOTFILES_DIR/zsh/git.zsh"
source_if_exists "$DOTFILES_DIR/zsh/aliases.zsh"
source_if_exists $HOME/.fzf.zsh
source_if_exists $HOME/.p10k.zsh # Powerlevel10k prompt: configure using `p10k configure`
# Local settings that should not be committed
source_if_exists ~/zshrc.local