dotfiles/zsh/.aliases

76 lines
2.2 KiB
Plaintext

#alias ltd='docker exec -it lt-dev /bin/bash'
#alias ltdf='docker exec -it lt-dev-2004 /bin/bash'
#alias lt-dd-f='docker exec -it lt-dev-2004 lt-dd'
#alias lt-dd-cms='lt-dd project:execute -p mpm-cms -n -- '
#alias lt-dd-web='lt-dd project:execute -p mpm-website -n -- '
#alias lt-dd-w2='lt-dd project:execute -p wrqr2 -n -- '
#alias fm='xinput set-prop 9 "libinput Scroll Method Enabled" 0, 0, 1 && xinput set-prop 9 "libinput Button Scrolling Button" 10'
# allow sudo before an alias
alias sudo=$'nocorrect sudo\t'
alias gcp='git cherry-pick'
alias gs='git status'
alias gdq='screen -d -m streamlink https://www.twitch.tv/gamesdonequick best -p mpv'
alias f=z
alias lg=lazygit
alias fixtime='sudo hwclock --hctosys'
#alias sc='./bin/console'
sc() {
# Step 1: Extract PHP version constraint from composer.json
local constraint=$(jq -r '.require.php // empty' composer.json | grep -oP '\d+\.\d+')
if [ -z "$constraint" ]; then
echo "No PHP version constraint found in composer.json"
return 1
fi
# Step 2: Try to find a matching installed PHP binary
local match=""
for ver in $(compgen -c php | grep -oP '^php\d+\.\d+' | sort -Vr); do
if [[ $ver =~ php$constraint ]]; then
match=$ver
break
fi
done
if [ -z "$match" ]; then
echo "No installed PHP binary matches constraint $constraint"
return 1
fi
# Step 3: Execute command with matched PHP binary
"$match" ./bin/console "${@}"
}
alias scme='sc make:entity'
alias scmf='sc make:form'
alias scmm='sc make:migration'
alias scdm='sc doctrine:migrations:migrate'
alias scdsd='sc doctrine:schema:update --dump-sql'
alias scdsf='sc doctrine:schema:update --force --dump-sql'
alias dbm='~/projects/dbmanager/bin/console'
alias python=python3
# eza overide
TREE_IGNORE="cache|log|logs|node_modules|vendor"
if type "eza" > /dev/null; then
alias ls=' eza --group-directories-first --git -l'
alias la=' ls -a'
alias ll=' ls'
alias l=' ll'
alias lt=' ls --tree -D -L 2 -I ${TREE_IGNORE}'
alias ltt=' ls --tree -D -L 3 -I ${TREE_IGNORE}'
alias lttt=' ls --tree -D -L 4 -I ${TREE_IGNORE}'
alias ltttt=' ls --tree -D -L 5 -I ${TREE_IGNORE}'
fi
if type "bashtop" > /dev/null; then
alias top='bashtop'
fi