From 1507b0c3c4b41cac171c761d8cebfb5998a3473e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Sun, 29 Dec 2024 13:43:54 +0100 Subject: [PATCH] feat(zsh): remove unneded variables add ~/.local/bin to path --- zsh/.zshenv | 3 +++ zsh/aliases.zsh | 8 ++++++- zsh/scripts.zsh | 59 +------------------------------------------------ 3 files changed, 11 insertions(+), 59 deletions(-) diff --git a/zsh/.zshenv b/zsh/.zshenv index e40d506..ee41515 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -4,6 +4,9 @@ export XDG_CACHE_HOME="$HOME/.cache" export XDG_DATA_HOME="$HOME/.local/share" export XDG_STATE_HOME="$HOME/.local/state" +# ~/.local/bin +export PATH="$HOME/.local/bin:$PATH" + # brew sbin export PATH="/opt/homebrew/sbin:$PATH" diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index e6dbe37..eb5914f 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -1,5 +1,5 @@ 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 vim=nvim_ve alias s="ssh-menu" @@ -22,3 +22,9 @@ alias ci="glab ci list" alias bm=batman 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' + +# ruff +alias ruffme="ruff format && ruff check --fix" + +# clipboard +alias xcp="xclip -selection c" diff --git a/zsh/scripts.zsh b/zsh/scripts.zsh index 6340917..17287b5 100644 --- a/zsh/scripts.zsh +++ b/zsh/scripts.zsh @@ -10,23 +10,6 @@ function 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 { RES=$(curl -s "https://$1/api/monitoring/requirements") COUNT=$(echo "$RES" | grep -c $2) @@ -71,7 +54,7 @@ function pyinit { function lh { if [[ -z $1 ]]; then - PORT=8000 + PORT=7999 else PORT=$1 fi @@ -87,32 +70,6 @@ function dps { 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 { if [[ -z $1 ]]; then echo "provide ssh host" @@ -122,17 +79,3 @@ function tssh { 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" -}