.dotfiles/.config/zsh/aliases/general.zsh
2024-03-02 17:23:58 +01:00

78 lines
2.5 KiB
Bash

function update() {
$TERM --hold -e "$SHELL" -c "sudo pacman -Syu && echo -e '\e[32mDONE\e[0m'" &
$TERM --hold -e "$SHELL" -c "flatpak update && echo -e '\e[32mDONE\e[0m'" &
$TERM --hold -e "$SHELL" -c "git --git-dir='$HOME/.dotfiles/' --work-tree='$HOME' submodule update --remote --recursive --init && echo -e '\e[32mDONE\e[0m'" &
}
alias pac='sudo pacman' \
vi='$EDITOR' \
qcp='qcp -o tabsize=4' \
qmv='qmv -o tabsize=4' \
mutt='neomutt'
alias config='git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"' \
viconf='(cd "$XDG_CONFIG_HOME/nvim" && $EDITOR .)' \
zconf='(cd "$ZDOTDIR/" && $EDITOR .) && . "$ZDOTDIR/.zshrc"'
alias valgrind='epitest valgrind' \
ssh='TERM=linux ssh'
function coloralias() {
$1 $(echo - "${@:2}" | sed 's/--color=\w\+/--color=always/')
}
alias _='sudo ' \
sudo='sudo ' \
watch='coloralias watch -c -- ' \
xargs='xargs '
function j() {
local cmd=(
find . -mount -name "$1*" -type d \
\! -path '*/.bzr/*' \
\! -path '*/.cache/*' \
\! -path '*/.git/*' \
\! -path '*/.hg/*' \
\! -path '*/.idea/*' \
\! -path '*/.svn/*' \
\! -path '*/.tox/*' \
\! -path '*/.venv/*' \
\! -path '*/.vscode/*' \
\! -path '*/CVS/*' \
\! -path '*/node_modules/*'
)
local dests=("${(@f)$(${cmd[@]} 2> /dev/null)}")
local dest="${dests:-$1}"
[ -n "${dests[2]}" ] && dest="$(printf '%s\n' "${dests[@]}" | fzf)"
cd "$dest"
}
function tmp() {
cd "$(mktemp -d --tmpdir "$1"XXX)"
}
alias -g ...='../..' \
....='../../..' \
.....='../../../..' \
......='../../../../..'
alias cp="cp -vi" \
mv="mv -vi" \
rm="rm -i" \
mkdir="mkdir -v" \
rsync="rsync -P"
alias ls='ls --color=tty' \
ll='ls -lh' \
l='ll -a' \
la='ll -A'
alias diff='diff --color'
alias grep="grep --color=auto --exclude-dir={.bzr,.cache,.git,.hg,.idea,.svn,.tox,.venv,.vscode,CVS,node_modules}" \
egrep="grep -E" \
fgrep="grep -F"
# vim: ft=zsh