Merge branch 'common'

This commit is contained in:
2018-01-29 13:15:50 +01:00
19 changed files with 149 additions and 52 deletions

View File

@@ -1,8 +1,3 @@
### TRANSLATIONS
alias vim="nvim"
alias urxvt="urxvt256c"
### COMMON OPERATIONS
alias ll='ls -AlFh'
alias la='ls -A'
@@ -26,8 +21,6 @@ alias calc='python3 -ic "from math import *; import cmath"'
alias le_haxxor_1='clear && dmesg | pv -qL 20'
alias le_haxxor_2='clear && hexdump -C /dev/urandom | pv -qlL 2'
alias b='cd $OLDPWD'
alias root='sudo -sE'
### USEFUL DEFAULT OPTIONS
@@ -69,3 +62,8 @@ alias tw="task"
alias twl="task list"
alias twa="task add"
alias twd="task done"
alias yaml2js="python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)'"
alias currentbranch='git rev-parse --abbrev-ref HEAD'
alias gpush='git push origin $(currentbranch)'

View File

@@ -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})"
}