mirror of
https://codeberg.org/vlw/dotfiles.git
synced 2026-04-13 07:39:38 +02:00
Compare commits
No commits in common. "b7e7151bb0c883763cc821277f3a0b7314757300" and "cf7792393cba1534af5ee890d15cae6ea2a0c4bb" have entirely different histories.
b7e7151bb0
...
cf7792393c
3 changed files with 3 additions and 34 deletions
|
|
@ -1,7 +1,3 @@
|
||||||
# +---------+
|
|
||||||
# | General |
|
|
||||||
# +---------+
|
|
||||||
|
|
||||||
# I'm lazy
|
# I'm lazy
|
||||||
alias e="exit"
|
alias e="exit"
|
||||||
alias n="nano"
|
alias n="nano"
|
||||||
|
|
@ -10,6 +6,8 @@ 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 |
|
||||||
|
|
@ -178,35 +176,10 @@ 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
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,3 @@ 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"
|
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,5 @@
|
||||||
"arguments": "on",
|
"arguments": "on",
|
||||||
"unknown": "off"
|
"unknown": "off"
|
||||||
},
|
},
|
||||||
"terminal.integrated.suggest.suggestOnTriggerCharacters": true,
|
"terminal.integrated.suggest.suggestOnTriggerCharacters": true
|
||||||
"terminal.integrated.initialHint": false
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue