mirror of
https://github.com/Xevion/dotfiles.git
synced 2025-12-10 06:06:59 -06:00
add chlg, chcode warning for --watch w/o file
This commit is contained in:
@@ -32,9 +32,23 @@ function gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}
|
||||
|
||||
function chcode() {
|
||||
EDITOR="code --wait"
|
||||
# If no arguments are provided, the chezmoi directory is opened
|
||||
if [[ "$@" == *"--watch"* ]]; then
|
||||
for arg in "$@"; do
|
||||
if [[ ! $arg == -* ]]; then
|
||||
chezmoi edit $@
|
||||
return
|
||||
fi
|
||||
done
|
||||
echo "--watch requires a file to be provided, directories aren't supported with watch mode"
|
||||
fi
|
||||
chezmoi edit $@
|
||||
}
|
||||
|
||||
function chlg() {
|
||||
lazygit --path ~/.local/share/chezmoi
|
||||
}
|
||||
|
||||
# Add an "alert" alias for long running commands. Use like so:
|
||||
# sleep 10; alert
|
||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
|
||||
Reference in New Issue
Block a user