depending on which parts you copy
lsdrangertreepacmanyayflatpakgit
paste in
~/.zshrcor~/.bashrc
alias l="lsd"
alias la="lsd -a"
alias ll="lsd -l"
alias lla="lsd -la"
alias lr="ranger ."
lt() { tree -C -L "${1:-2}" "${@:2}" | less; }
alias c="clear"
alias pac="sudo pacman"
alias i="pac -S"
alias u="pac -Sy"
alias U="pac -Syu"
alias r="pac -R"
alias yi="yay -S"
alias yu="yay -Sy"
alias yU="yay -Syu"
alias yr="yay -R"
alias fp="flatpak"
alias fpi="fp install"
alias fpu="fp update"
alias fpr="fp remove"
UPDATE() {
echo "➡️ KDE themes/icons/... can't be updated here. This will update using pacman and flatpak"
U
yU
fpu
}
alias g="git"
alias gr="g reset HEAD~"
alias gp="g push"
alias gP="gp --force-with-lease"
alias gPP="gp --force"
alias gs="g stash"
alias gsp="gs pop"
unalias gss >/dev/null
gss() { git stash push --staged -m "$*"; }
alias gsl="gs list"
alias gsa="gs apply"
gsA() {
gsa $1
gs drop $1
}
# amend + push
gcP() {
git commit --amend --no-edit
gP
}better fonts
icons in ranger
export EDITOR=nano
export VISUAL=nano
export LESS="-R --use-color"
export LESSEDITOR="nano"
his() {
local msg from to f="$HOME/.zsh_history" b=".bak"
local date dateFormat="%Y-%m-%d %H:%M:%S"
case "$1" in
bak) from="" to="$b" msg="history copied ——>" ;;
res) from="$b" to="" msg="history restored <——" ;;
*) echo "usage: his {bak|res}"; return 1 ;;
esac
if [ -e "$f$from" ]; then
if stat -c '%y' "$f$from" >/dev/null 2>&1; then
date=$(stat -c '%y' "$f$from")
elif stat -f '%Sm' -t $dateFormat "$f$from" >/dev/null 2>&1; then
date=$(stat -f '%Sm' -t $dateFormat "$f$from")
else
date=$(date -r "$f$from" $dateFormat 2>/dev/null || echo 'unknown')
fi
fi
cp -p "$f$from" "$f$to"
echo $msg $date
}