-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
82 lines (67 loc) · 2.48 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env zsh
# Run cross shell configuration
source ~/.shrc
export ZSH="$HOME/.oh-my-zsh" # Path to oh-my-zsh installation
export ZSH_CONFIG="$HOME/.zshrc"
export ZSH_CUSTOM="$ZSH/custom"
export ZSH_COMPDUMP="$ZSH_CACHE_DIR/.zcompdump-$SHORT_HOST-$ZSH_VERSION"
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=8"
mkdir -p "$XDG_STATE_HOME/zsh" # zsh doesn't create it
HISTFILE="$XDG_STATE_HOME/zsh/history"
SAVEHIST=1000000
HISTSIZE=2000000
setopt EXTENDED_HISTORY # Record timestamp in history
setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history
setopt HIST_IGNORE_DUPS # Dont record an entry that was just recorded again
setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate
setopt HIST_FIND_NO_DUPS # Do not display a line previously found
setopt HIST_IGNORE_SPACE # Dont record an entry starting with a space
setopt HIST_SAVE_NO_DUPS # Dont write duplicate entries in the history file
setopt SHARE_HISTORY # Share history between all sessions
setopt HIST_VERIFY # Do not execute commands using history (e.g.: using !$) immediately
ZSH_THEME="mlh"
MLH_AT_SYMBOL=" at "
MLH_IN_SYMBOL=" in "
MLH_ON_SYMBOL=" on "
MLH_SHELL_SYMBOL="$ "
CASE_SENSITIVE="true" # ohmyzsh: use case-sensitive completion
plugins=(
1password
adb
brew
# docker - works automatically when brew-installed
# dotnet
`#fzf` $([ -x "$(command -v fzf)" ] && echo 'fzf')
# flutter
gradle
# gradle-completion
macos
pod
swiftpm
terraform
zsh-autosuggestions
zsh-syntax-highlighting
)
# See https://github.com/ohmyzsh/ohmyzsh/pull/12281#issuecomment-1999588857
zstyle ':omz:plugins:gradle' aliases no
if command -v brew >/dev/null 2>&1; then
# Set up completions for `brew` command and `brew`-installed programs
# See: https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh
FPATH="$(brew --prefix)/share/zsh/site-functions:$FPATH"
# Set up zsh-completions
FPATH="$(brew --prefix)/share/zsh-completions:$FPATH"
fi
if [ -d "$ZSH" ]; then
source "$ZSH/oh-my-zsh.sh"
# oh-my-zsh initializes completion, so shrc needs to be sourced before it.
# oh-my-zsh sets aliases, so aliases needs to be sourced after it.
FPATH="$ZSH_CACHE_DIR/completions:$FPATH"
fi
# make CMD+Delete delete line before the cursor (not the whole line)
bindkey \^U backward-kill-line
# Auto-insert first completion https://unix.stackexchange.com/q/12288/417321
setopt menu_complete
# Disable the annoying beep
unsetopt beep
# Load cross-shell aliases
source "$HOME/.dotfiles/script/aliases"