feat(zsh): remove unneded variables add ~/.local/bin to path

This commit is contained in:
Matej Janezic 2024-12-29 13:43:54 +01:00
parent 9837828c72
commit 1507b0c3c4
Signed by: janezicmatej
GPG Key ID: 4298E230ED37B2C0
3 changed files with 11 additions and 59 deletions

View File

@ -4,6 +4,9 @@ export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share" export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state" export XDG_STATE_HOME="$HOME/.local/state"
# ~/.local/bin
export PATH="$HOME/.local/bin:$PATH"
# brew sbin # brew sbin
export PATH="/opt/homebrew/sbin:$PATH" export PATH="/opt/homebrew/sbin:$PATH"

View File

@ -1,5 +1,5 @@
alias z="exec zsh" alias z="exec zsh"
alias t="tmux a || tmux new-session -s $(whoami) -c ~" alias t="tmux a || ~/.config/tmux/tmux-sessionizer ~"
alias n=nvim_ve alias n=nvim_ve
# alias vim=nvim_ve # alias vim=nvim_ve
alias s="ssh-menu" alias s="ssh-menu"
@ -22,3 +22,9 @@ alias ci="glab ci list"
alias bm=batman alias bm=batman
alias grow="~/.local/bin/cbonsai -liWC -M 15 -t 2 -w 60 -s $(date +%s)" alias grow="~/.local/bin/cbonsai -liWC -M 15 -t 2 -w 60 -s $(date +%s)"
alias clean_ds_store='find . -name ".DS_Store" -type f -delete -print' alias clean_ds_store='find . -name ".DS_Store" -type f -delete -print'
# ruff
alias ruffme="ruff format && ruff check --fix"
# clipboard
alias xcp="xclip -selection c"

View File

@ -10,23 +10,6 @@ function nvim_ve {
alias nvim=nvim_ve alias nvim=nvim_ve
function ffb {
if ! [[ -f package.json ]]; then
echo "no package.json"
return
fi
if [[ -f yarn.lock ]]; then
PACKAGE_MANAGER=yarn
else
PACKAGE_MANAGER=npm
fi
if [[ -n $(grep "react-scripts" package.json) ]]; then
BROWSER=none FORCE_COLOR=true "$PACKAGE_MANAGER" start | cat
fi
}
function afm { function afm {
RES=$(curl -s "https://$1/api/monitoring/requirements") RES=$(curl -s "https://$1/api/monitoring/requirements")
COUNT=$(echo "$RES" | grep -c $2) COUNT=$(echo "$RES" | grep -c $2)
@ -71,7 +54,7 @@ function pyinit {
function lh { function lh {
if [[ -z $1 ]]; then if [[ -z $1 ]]; then
PORT=8000 PORT=7999
else else
PORT=$1 PORT=$1
fi fi
@ -87,32 +70,6 @@ function dps {
fi fi
} }
function get_dump {
if [[ -z $1 ]]; then
echo "provide ssh host"
return
fi
if [[ -z $2 ]]; then
echo "provide dump destination"
return
fi
selected=$(ssh "$1" docker ps --format "{{.Names}}" | fzf)
if [[ -z $selected ]]; then
return
fi
ssh "$1" docker exec "$selected" pg_dump -U db --format=c db >"$2$(date +'%Y-%m-%dT%H.%M.%S%z')"
}
function ggcompile {
find -L "$GGROOT" -mindepth 1 -maxdepth 5 -type d -name .git -prune \
-exec dirname {} \; >"$GGROOT/compiled"
}
function tssh { function tssh {
if [[ -z $1 ]]; then if [[ -z $1 ]]; then
echo "provide ssh host" echo "provide ssh host"
@ -122,17 +79,3 @@ function tssh {
ssh -t "$@" "command -v tmux && (tmux a || tmux new-session -s gorazd -c ~) || bash" ssh -t "$@" "command -v tmux && (tmux a || tmux new-session -s gorazd -c ~) || bash"
} }
function ssh-menu {
selected=$(
grep 'Host .*' ~/.ssh/config \
| grep -v '*' \
| sed 's/Host \(.*\)/\1/' \
| fzf --cycle --bind 'tab:toggle-up,btab:toggle-down'
)
if [[ -z $selected ]]; then
return
fi
ssh "$selected"
}