Command for shenanigans
This commit is contained in:
parent
1a8c9d7c5a
commit
99e0927c00
2 changed files with 19 additions and 0 deletions
|
@ -23,3 +23,13 @@ else
|
||||||
col=33;
|
col=33;
|
||||||
fi
|
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\] "
|
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"
|
||||||
|
}
|
||||||
|
|
|
@ -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_VERIFY # Don't execute immediately upon history expansion.
|
||||||
unsetopt HIST_BEEP # Beep when accessing nonexistent history.
|
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"
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue