Add zsh functions, start tmux right on start.

This commit is contained in:
CronyAkatsuki 2025-02-01 17:50:20 +01:00
parent c926deac3d
commit b97d67044d
2 changed files with 62 additions and 0 deletions

View file

@ -0,0 +1,43 @@
#!/usr/bin/env zsh
# Open a script in path with vim quicly
vish () {
nvim $(which $1)
}
# Create a directory and change into it
md () {
mkdir -p "$@" && cd "$@"
}
# Move a file and create a link in it's place
mvln () {
from=$(readlink -f $1)
to="$2"
[ ! -d "$(dirname $to)" ] && mkdir -p "$(dirname $to)"
mv $from $to
ln -s $to $from
}
# nnn
n () {
# Block nesting of nnn in subshells
[ "${NNNLVL:-0}" -eq 0 ] || {
echo "nnn is already running"
return
}
# Tempfile location
NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
nnn "$@"
[ ! -f "$NNN_TMPFILE" ] || {
. "$NNN_TMPFILE"
rm -f "$NNN_TMPFILE" > /dev/null
}
}
# upfast
upfast () {
curl -F "file=@$(readlink -f $1)" "https://upfast.cronyakatsuki.xyz/"
}