-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc
99 lines (77 loc) · 3 KB
/
dot_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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Set up the prompt
autoload -Uz promptinit
promptinit
# Share history between shells
setopt histignorealldups sharehistory
# Use emacs keybindings
bindkey -e
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history
# Load homebrew completitions if available
if type brew &>/dev/null
then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
fi
# Use modern completion system
autoload -Uz compinit
compinit
zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' menu select=2
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
zstyle ':completion:*' menu select=long
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose true
zstyle ':completion::complete:*' gain-privileges 1
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
# Enable Starship Prompt
eval "$(starship init zsh)"
#source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
#ZSH_HIGHLIGHT_DIRS_BLACKLIST+=(/mnt/c)
# Enable FZF integration
source /opt/homebrew/opt/fzf/shell/completion.zsh
source /opt/homebrew/opt/fzf/shell/key-bindings.zsh
# Enable thefuck
#eval $(thefuck --alias --enable-experimental-instant-mode)
# Add ztcp support
zmodload zsh/net/tcp
# Aliases and modern tool replacements
alias ll="ls -alh"
alias l="ls"
alias ls="ls --color=auto"
#alias cat="bat"
#alias tree="eza --tree -alh"
alias vim="nvim"
alias tf="terraform"
alias kctl="kubectl"
alias cls="clear"
# Add go binaries
export PATH="${PATH}:${HOME}/go/bin"
# Add krew plugins
export PATH="${PATH}:${HOME}/.krew/bin"
# Add GraalVM
export PATH=/Library/Java/JavaVirtualMachines/graalvm-20.jdk/Contents/Home/bin:"$PATH"
export SOPS_AGE_KEY_FILE="${HOME}/.age/key.txt"
# configure Window Title
#autoload -Uz add-zsh-hook
#function xterm_title_precmd () {
# print -Pn -- '\e]2;%n@%m %~\a'
# [[ "$TERM" == 'screen'* ]] && print -Pn -- '\e_\005{g}%n\005{-}@\005{m}%m\005{-} \005{B}%~\005{-}\e\\'
#}
#function xterm_title_preexec () {
# print -Pn -- '\e]2;%n@%m %~ %# ' && print -n -- "${(q)1}\a"
# [[ "$TERM" == 'screen'* ]] && { print -Pn -- '\e_\005{g}%n\005{-}@\005{m}%m\005{-} \005{B}%~\005{-} %# ' && print -n -- "${(q)1}\e\\"; }
#}
#if [[ "$TERM" == (Eterm*|alacritty*|aterm*|gnome*|konsole*|kterm*|putty*|rxvt*|screen*|tmux*|xterm*) ]]; then
# add-zsh-hook -Uz precmd xterm_title_precmd
# add-zsh-hook -Uz preexec xterm_title_preexec
#fi