Merge branch 'common'
This commit is contained in:
@@ -148,6 +148,10 @@ resolvecd() {
|
||||
cd "$(readlink -f $(pwd))"
|
||||
}
|
||||
|
||||
sshmux () {
|
||||
ssh -t $@ "tmux a || tmux";
|
||||
}
|
||||
|
||||
t() {
|
||||
if [[ "$1" ]] ; then
|
||||
tmux new-session -A -s "$1"
|
||||
@@ -155,3 +159,21 @@ t() {
|
||||
tmux attach-session
|
||||
fi
|
||||
}
|
||||
|
||||
b() {
|
||||
bookmarks=${DOTFILES}/bookmarks
|
||||
bookmark="$1"
|
||||
if ! [[ "${bookmark}" ]] ; then
|
||||
printf 'Need a bookmark' >&2
|
||||
return 1
|
||||
fi
|
||||
if ! [[ -r "${bookmark}" ]] ; then
|
||||
printf 'Invalid bookmark %s' "${bookmark}" >&2
|
||||
return 1
|
||||
fi
|
||||
target="$(head -1 ${bookmark})"
|
||||
if ! [[ -e "${target}" ]] ; then
|
||||
printf 'Traget not found: %s' "${target}" >&2
|
||||
fi
|
||||
cd "$(eval ${target})"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user