-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
160 lines (124 loc) · 4.98 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
export XDG_CONFIG_HOME="$HOME/.config"
# Set the directory we want to store zinit and plugins
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
# Download Zinit, if it's not there yet
if [ ! -d "$ZINIT_HOME" ]; then
mkdir -p "$(dirname $ZINIT_HOME)"
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
fi
# Source/Load zinit
source "${ZINIT_HOME}/zinit.zsh"
# Hook direnv
export DIRENV_LOG_FORMAT=""
eval "$(direnv hook zsh)"
# Init homebrew
eval $(/opt/homebrew/bin/brew shellenv)
# Init oh-my-posh
eval "$(oh-my-posh init zsh --config ~/.config/oh-my-posh/tokyonight_storm.qmi.toml)"
# Add zsh plugins
zinit light zsh-users/zsh-syntax-highlighting
zinit light zsh-users/zsh-completions
zinit light zsh-users/zsh-autosuggestions
zinit light Aloxaf/fzf-tab
zinit light MichaelAquilina/zsh-you-should-use
# Add snippets
zinit snippet OMZP::git
zinit snippet OMZP::tmux
zinit snippet OMZP::command-not-found
export PATH="$PATH:/Users/phamvoquangminh/.local/bin"
eval $(thefuck --alias)
zinit snippet OMZP::thefuck
autoload -U compinit && compinit
zinit cdreplay -q
# Keybindings
bindkey -e # Emacs
bindkey '^p' history-search-backward
bindkey '^n' history-search-forward
# History
HISTSIZE=5000
HISTFILE=~/.zsh_history
SAVEHIST=$HISTSIZE
HISTDUP=erase
setopt appendhistory
setopt sharehistory
setopt hist_ignore_space
setopt hist_ignore_all_dups
setopt hist_save_no_dups
setopt hist_ignore_dups
setopt hist_find_no_dups
# Completion styling
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
# Aliases
alias zshconfig="nvim ~/.zshrc"
alias ls='ls --color'
alias lsa='ls -lAh'
alias oke="echo oke"
alias cool="echo cool"
alias htop="btop"
alias cat='bat -p -P'
alias antlr4py3='java org.antlr.v4.Tool -Dlanguage=Python3 -o target'
alias installdir='dirname "$(pwd)"'
alias pygrun='python3 "$(installdir)"/bin/pygrun'
alias antlr4='java -jar /usr/local/lib/antlr-4.9.2-complete.jar -o target'
alias grun='java org.antlr.v4.runtime.misc.TestRig'
# Shell integrations
eval "$(fzf --zsh)"
eval "$(zoxide init --cmd cd zsh)"
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='nvim'
fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
################################################################################
# ZSH PLUGINS VARIABLES
# tmux
export ZSH_TMUX_AUTOSTART=false
export ZSH_TMUX_AUTOSTART_ONCE=true
export ZSH_TMUX_AUTOCONNECT=true
export ZSH_TMUX_AUTOQUIT=ZSH_TMUX_AUTOSTART
# ZSH_TMUX_CONFIG Set the configuration path (default: $HOME/.tmux.conf, $XDG_CONFIG_HOME/tmux/tmux.conf)
# ZSH_TMUX_DEFAULT_SESSION_NAME Set tmux default session name when autostart is enabled
export ZSH_TMUX_AUTONAME_SESSION=true
export ZSH_TMUX_DETACHED=false
# ZSH_TMUX_FIXTERM Sets $TERM to 256-color term or not based on current terminal support
# ZSH_TMUX_FIXTERM_WITHOUT_256COLOR $TERM to use for non 256-color terminals (default: tmux if available, screen otherwise)
# ZSH_TMUX_FIXTERM_WITH_256COLOR $TERM to use for 256-color terminals (default: tmux-256color if available, screen-256color otherwise)
# ZSH_TMUX_ITERM2 Sets the -CC option for iTerm2 tmux integration (default: false)
# ZSH_TMUX_UNICODE Set tmux -u option to support unicode
################################################################################
################################################################################
# Software initialize from here
# Ollama
export OLLAMA_HOST=localhost:11435
# postgresql homebrew
# export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH"
# export LDFLAGS="-L/opt/homebrew/opt/postgresql@16/lib"
# export CPPFLAGS="-I/opt/homebrew/opt/postgresql@16/include"
# export PKG_CONFIG_PATH="/opt/homebrew/opt/postgresql@16/lib/pkgconfig"
# ANTLR
export ANTLR_JAR=/usr/local/lib/antlr-4.9.2-complete.jar
export CLASSPATH=".:/usr/local/lib/antlr-4.9.2-complete.jar:$CLASSPATH"
## openjdk
# export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
# Haskell
[ -f "/Users/phamvoquangminh/.ghcup/env" ] && source "/Users/phamvoquangminh/.ghcup/env" # ghcup-env
# Julia
export PATH="/Applications/Julia-1.8.app/Contents/Resources/julia/bin:$PATH"
# cargo
export PATH="$HOME/.cargo/bin:$PATH"
# THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
# <<< JVM installed by coursier <<<
export JAVA_HOME="/Users/phamvoquangminh/Library/Caches/Coursier/arc/https/github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11%252B28/OpenJDK11-jdk_x64_mac_hotspot_11_28.tar.gz/jdk-11+28/Contents/Home"
# <<< JVM installed by coursier <<<
# Zig
export PATH="$HOME/zig-bootstrap-0.14.0-dev.2064+b5cafe223/out/zig-aarch64-macos-none-baseline:$PATH"
# eval "$(pixi completion --shell zsh)"