loadout/zsh/aliases

39 lines
851 B
Plaintext
Raw Permalink Normal View History

2017-10-18 00:12:57 +00:00
alias grep='grep --color=auto'
alias lal='ls -la'
alias src='cd ~/src/'
alias s='src && ls'
alias gosrc='cd ~/src/go/src'
alias gs='gosrc && ls'
alias t='tmuxn'
alias tmuxn='tmux new -s'
alias ta='tmuxa'
alias tmuxa='tmux attach -d -t'
alias tls='tmux ls'
alias cb='xsel -bi; xsel -bo'
alias rsyncv='rsync -av --progress'
function psgrep {
ps aux | grep -P "[^]]$1"
}
function pskill {
PROCS=$(psgrep "$1")
echo "$PROCS"
echo "$PROCS" | awk '{print $2}' | xargs kill
}
# takes in a search regex and a replace string, and does a recursive
# find/replace inside the current directory. Safe to run on repos with .git
# folders and shit like that
function agsed {
search="$1"
replace="$2"
files=$(ag "$search" -l0)
echo -n "$files" | xargs -0 -n1 echo
echo -n "$files" | xargs -0 sed -i "s/$search/$replace/g"
}