.dotfiles/configs/zsh/aliases.sh

82 lines
1.8 KiB
Bash
Raw Normal View History

2020-11-07 14:03:30 +01:00
## ALIASIES ##
2023-02-25 17:12:20 +01:00
# This function emits an OSC 1337 sequence to set a user var
# associated with the current terminal pane.
# It requires the `base64` utility to be available in the path.
# This function is included in the wezterm shell integration script, but
# is reproduced here for clarity
__wezterm_set_user_var() {
if hash base64 2>/dev/null ; then
if [[ -z "${TMUX}" ]] ; then
printf "\033]1337;SetUserVar=%s=%s\007" "$1" `echo -n "$2" | base64`
else
# <https://github.com/tmux/tmux/wiki/FAQ#what-is-the-passthrough-escape-sequence-and-how-do-i-use-it>
# Note that you ALSO need to add "set -g allow-passthrough on" to your tmux.conf
printf "\033Ptmux;\033\033]1337;SetUserVar=%s=%s\007\033\\" "$1" `echo -n "$2" | base64`
fi
fi
}
function _run_prog() {
# set PROG to the program being run
__wezterm_set_user_var "PROG" "$1"
# arrange to clear it when it is done
trap '__wezterm_set_user_var PROG ""' EXIT
# and now run the corresponding command, taking care to avoid looping
# with the alias definition
command "$@"
}
2020-11-07 14:03:30 +01:00
alias -s {yml,yaml,ts,json,js,vim,rc}=nvim
2021-08-10 21:50:49 +02:00
alias c="code ."
2021-04-26 10:29:18 +02:00
alias ca="c -a"
alias cr="c -r"
2021-04-23 15:23:49 +02:00
2020-11-07 14:03:30 +01:00
alias yoink="curl"
alias pls='sudo -E env "PATH=$PATH"'
2022-01-14 16:14:57 +01:00
alias online="ping 1.1.1.1"
2023-02-25 17:12:20 +01:00
alias vim="_run_prog nvim"
alias v="_run_prog nvim"
2020-11-07 14:03:30 +01:00
alias gcm="git commit -m "
2022-03-01 23:25:44 +01:00
alias D="run dev"
alias B="run build"
alias T="run test"
2021-08-23 17:00:03 +02:00
alias P="git push"
2021-11-17 14:04:03 +01:00
alias p="git pull"
2021-03-23 13:38:09 +01:00
2020-11-07 14:03:30 +01:00
alias lt="tree -L 2 --filelimit 150 --dirsfirst"
2023-06-22 17:17:26 +02:00
alias captive="xdg-open http://$(ip --oneline route get 1.1.1.1 | awk '{print $3}')"
2023-05-03 09:23:13 +02:00
if docker compose &> /dev/null
then
alias dc="sudo docker compose"
else
alias dc="sudo docker-compose"
fi
2023-07-27 13:41:56 +02:00
2023-04-09 15:31:42 +02:00
alias d="sudo docker"
2022-09-02 16:15:54 +02:00
alias t="tmux"
2022-10-06 21:14:32 +02:00
alias nx="pnpm exec nx"
2023-01-25 16:35:57 +01:00
alias pm="pnpm prisma"
2022-11-19 18:38:42 +01:00
if type lsd &> /dev/null; then
alias ls="lsd"
fi
if type bat &> /dev/null; then
alias cat="bat"
fi