Command for shenanigans

This commit is contained in:
Geoffrey Frogeye 2025-09-23 00:08:46 +02:00
parent 1a8c9d7c5a
commit 99e0927c00
2 changed files with 19 additions and 0 deletions

View file

@ -23,3 +23,13 @@ else
col=33;
fi
export PS1="\[\e]2;\u@\H \w\a\]\[\e[0;37m\][\[\e[0;${col}m\]\u\[\e[0;37m\]@\[\e[0;34m\]\h \[\e[0;36m\]\W\[\e[0;37m\]]\$\[\e[0m\] "
# Replace the content of a symlinked file
# Useful for ad-hoc replacing of Nix config files
subl() {
[ -f "$1" ] || return 3
[ -h "$1" ] || return 4
src="$(readlink -f "$1")"
rm "$1"
cat "$src" > "$1"
}

View file

@ -110,3 +110,12 @@ setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording en
unsetopt HIST_VERIFY # Don't execute immediately upon history expansion.
unsetopt HIST_BEEP # Beep when accessing nonexistent history.
# Replace the content of a symlinked file
# Useful for ad-hoc replacing of Nix config files
subl() {
[ -f "$1" ] || return 3
[ -h "$1" ] || return 4
src="$(readlink -f "$1")"
rm "$1"
< "$src" > "$1"
}