Add stv and ishelp to shell_aliases
Fix pushdot and getdot functions
This commit is contained in:
parent
94ffef797d
commit
b8f38ee429
|
@ -1,5 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
function ishelp {
|
||||
[[ "$1" == "help" ]] || [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]
|
||||
}
|
||||
|
||||
function stv {
|
||||
local stash=0
|
||||
if ishelp $1; then
|
||||
echo "Show the diff for the given stash. Default to 0"
|
||||
return
|
||||
fi
|
||||
if [[ "${1:0:1}" == "^" ]]; then
|
||||
stash=${#1}
|
||||
elif [[ "$1" != "" ]]; then
|
||||
stash="$1"
|
||||
fi
|
||||
git stash show -p stash@{$stash}
|
||||
}
|
||||
|
||||
function hearch {
|
||||
history 0 | sed 's/[0-9 ]*//' | grep "$@"
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
export SCRIPT_DIR="${0:A:h}"
|
||||
|
||||
if test -f /usr/share/doc/fzf/examples/completion.zsh &> /dev/null; then
|
||||
source /usr/share/doc/fzf/examples/completion.zsh
|
||||
fi
|
||||
|
@ -65,7 +67,7 @@ if [ "$TERM" = "linux" ]; then
|
|||
fi
|
||||
|
||||
function pushdot {
|
||||
cd ~/.dotfiles &&
|
||||
cd "$SCRIPT_DIR" || return 1
|
||||
if [ $# -eq 0 ]; then
|
||||
git commit -a && git push -u origin master &
|
||||
else
|
||||
|
@ -75,7 +77,7 @@ function pushdot {
|
|||
}
|
||||
|
||||
function getdot {
|
||||
cd ~/.dotfiles &&
|
||||
cd "$SCRIPT_DIR" || return 1
|
||||
git pull
|
||||
cd -
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue