-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
148 lines (120 loc) · 3.88 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
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
# ZSH_THEME="geometry"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git zsh-autosuggestions F-Sy-H)
source $ZSH/oh-my-zsh.sh
# User configuration
# fpath+=~/.zfunc
# setopt autocd
#
# # autoload -U compinit && compinit
# autoload -Uz compinit
# if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then
# compinit;
# touch ~/.zcompdump
# else
# compinit -C;
# fi;
export VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true
export VI_MODE_SET_CURSOR=true
export KEYTIMEOUT=1
# export GEOMETRY_PROMPT_PLUGINS_PRIMARY=(geometry_virtualenv)
function take {
mkdir -p $1
cd $1
}
# force emacs mode on shell
# TODO: figure how to make vim mode play nice with ^f
bindkey -e
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='nvim'
else
export EDITOR='nvim'
fi
# Compilation flags
if uname -a | grep -q "arm64"; then
# Apple Silicon
export ARCHFLAGS="-arch arm64"
else
# Intel
export ARCHFLAGS="-arch x86_64"
fi
# Aliases
alias vim="$(which nvim)"
alias ls="$(which exa)"
alias lsa="$(which exa) -lah"
alias tree="$(which exa) --tree"
alias ga="$(which git) add"
alias gc="$(which git) commit"
alias gst="$(which git) status"
alias cx="$(which exa) $1 && cd $1"
alias pclean="$(which podman) container rm --all -v"
alias nerd="$(which nerdctl)"
alias tf="$(which terraform)"
alias python="$(which python3)"
alias sqlite="$(which sqlite3)"
alias pdb="$(which python3) -m pdb"
alias hf="$(which huggingface-cli)"
# [f]ind [w]ith fzf
alias fw="fzf --preview 'bat --color \"always\" {}'"
alias cargofix="cargo clippy --fix --allow-dirty --allow-staged"
alias cargofmt="cargo fmt"
alias dps="docker ps"
alias dpsa="docker ps -a"
alias \$=''
alias rm="$(which trash)"
alias k="kubectl"
# autocd into previous directory
alias -- -="cd -"
# Exports
export NCONF="$HOME/.config/nvim/"
export NEOVIM_BIN="$(which nvim)"
LOCAL_BIN="$HOME/.local/bin"
SBIN="/usr/local/sbin"
export PATH="$SBIN:$LOCAL_BIN:$PATH"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
if [ "$TERM_PROGRAM" = tmux ]; then
bindkey -s ^f "tmux-sessionizer\n"
fi
export PIP_REQUIRE_VIRTUALENV=true
load_kubectl_env() {
[[ /usr/local/bin/kubectl ]] && source <(kubectl completion zsh)
}
load_plugins_env() {
load_kubectl_env
echo "kubectl loaded"
}
export MODULAR_HOME="$HOME/.modular"
export PATH="$HOME/.modular/pkg/packages.modular.com_mojo/bin:$PATH"
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /opt/homebrew/bin/terraform terraform
# >>> mamba initialize >>>
# !! Contents within this block are managed by 'mamba init' !!
export MAMBA_EXE='/opt/homebrew/bin/micromamba'
export MAMBA_ROOT_PREFIX='/Users/nopestack/.micromamba'
__mamba_setup="$("$MAMBA_EXE" shell hook --shell zsh --root-prefix "$MAMBA_ROOT_PREFIX" 2>/dev/null)"
if [ $? -eq 0 ]; then
eval "$__mamba_setup"
else
alias micromamba="$MAMBA_EXE" # Fallback on help from mamba activate
fi
unset __mamba_setup
# <<< mamba initialize <<<