Compare commits

...

3 commits

3 changed files with 34 additions and 3 deletions

View file

@ -1,3 +1,7 @@
# +---------+
# | General |
# +---------+
# I'm lazy # I'm lazy
alias e="exit" alias e="exit"
alias n="nano" alias n="nano"
@ -6,8 +10,6 @@ alias n="nano"
alias phpa="sudo update-alternatives --config php" alias phpa="sudo update-alternatives --config php"
# Restart all code-server processes. Sometimes it hangs on first startup # Restart all code-server processes. Sometimes it hangs on first startup
alias restart_vscode="sudo systemctl restart code-server@vlw.service" alias restart_vscode="sudo systemctl restart code-server@vlw.service"
# Force undo and unstage the last commit from git and git remote
alias gitundo="git reset HEAD^ && git push origin +HEAD"
# +-------------------+ # +-------------------+
# | Directory & Files | # | Directory & Files |
@ -176,10 +178,35 @@ mvf () {
ll $1 ll $1
} }
# Move target to the trash directory and clean up expired items
trash () {
local days=30
# Create trash directory if it does not exist
if [[ ! -d "$TRASH_DIR" ]]; then
mkdir "$TRASH_DIR"
echo "Created: $TRASH_DIR"
fi
# Remove expired files
find "$TRASH_DIR" -mindepth 1 -type f -mtime +"$days" -print0 | xargs -0 --no-run-if-empty rm -f --
# Remove expired directories
find "$TRASH_DIR" -mindepth 1 -type d -mtime +"$days" -print0 | xargs -0 --no-run-if-empty rm -rf --
# Move target to trash if specified
if [ -e "$1" ]; then
mv "$1" "$TRASH_DIR"
fi
}
# +-----+ # +-----+
# | Git | # | Git |
# +-----+ # +-----+
# Force undo and unstage the last commit from git and git remote
alias gitundo="git reset HEAD^ && git push origin +HEAD"
# Short-hands for various git functions # Short-hands for various git functions
gitf () { gitf () {
case "$1" in case "$1" in

View file

@ -23,3 +23,6 @@ export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_DATA_HOME="$HOME/.local/share" export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache" export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
# Use this directory for storing trashed items
export TRASH_DIR="$XDG_DATA_HOME/Trash"

View file

@ -48,5 +48,6 @@
"arguments": "on", "arguments": "on",
"unknown": "off" "unknown": "off"
}, },
"terminal.integrated.suggest.suggestOnTriggerCharacters": true "terminal.integrated.suggest.suggestOnTriggerCharacters": true,
"terminal.integrated.initialHint": false
} }