diff options
Diffstat (limited to 'zsh/aliases')
-rw-r--r-- | zsh/aliases | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/zsh/aliases b/zsh/aliases new file mode 100644 index 0000000..1c71cea --- /dev/null +++ b/zsh/aliases @@ -0,0 +1,38 @@ +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" +} |