Fun with work-ish zsh stuff

main
Dan Buch 1 month ago
parent f27cf30bd9
commit 946c21e03f
Signed by: meatballhat
GPG Key ID: A12F782281063434

37
zshrc

@ -42,14 +42,12 @@ fi
path=(
$HOME/.rbenv/shims
$HOME/.pyenv/shims
$HOME/bin
$HOME/go/bin
$HOME/.local/bin
$HOME/.cargo/bin
$HOME/.rbenv/bin
$HOME/.phpenv/bin
$HOME/.pyenv/bin
$HOME/.yarn/bin
$HOME/.pulumi/bin
${KREW_ROOT:-$HOME/.krew}/bin
@ -97,7 +95,6 @@ plugins=(
pip
podman
postgres
pyenv
python
rails
rake-fast
@ -109,7 +106,6 @@ plugins=(
symfony-complete
tmux
vagrant
vault
vi-mode
yarn
)
@ -133,6 +129,8 @@ export EDITOR=vim
export PYENV_ROOT="${HOME}/.pyenv"
export SDKMAN_DIR="${HOME}/.sdkman"
export VISUAL=vim
export PTD_CACHE="${HOME}/.local/ptd"
export PTD_ROOT="${HOME}/code/rstudio/ptd/infra"
# The completion for aws is not compatible with $fpath :scream_cat:
if [[ -f /usr/local/share/zsh/site-functions/_aws ]] ; then
@ -173,7 +171,13 @@ unsetopt correct_all
bindkey '^R' history-incremental-search-backward
if which pyenv >/dev/null; then
eval "$(pyenv init - 2>/dev/null)"
if [[ "${HATCH_ENV_ACTIVE}" ]]; then
: skipping pyenv when inside a hatch env
else
path=($HOME/.pyenv/shims $HOME/.pyenv/bin "${path[@]}")
plugins=("${plugins[@]}" pyenv)
eval "$(pyenv init - 2>/dev/null)"
fi
fi
if which phpenv >/dev/null; then
@ -226,6 +230,23 @@ function docker-cleanup() {
done
}
function ptd-completion() {
if command -v ptd &>/dev/null; then
eval "$(_PTD_COMPLETE=zsh_source ptd)"
fi
}
function mksecret() {
local nbytes="${1:-42}"
python3 <<EOPYTHON | tr -d '/' | tr -d '+' | cut -b1-$((nbytes - 1))
import secrets
import base64
print(base64.b64encode(secrets.token_bytes(${nbytes} * 2)).decode(), end="")
EOPYTHON
}
export NVM_DIR="${HOME}/.nvm"
__maybesource ~/.zshenv
@ -265,6 +286,12 @@ fi
compdef _symfony_complete composer
compdef _symfony_complete dep
alias fz=fuzzbucket-client
if ptd --version &>/dev/null; then
ptd-completion
fi
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

Loading…
Cancel
Save