diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2017-10-17 18:12:57 -0600 |
---|---|---|
committer | mediocregopher <mediocregopher@gmail.com> | 2021-10-03 17:22:56 -0600 |
commit | 07ab3a77b44944a1ac234fbd717391f36370416e (patch) | |
tree | edd959740bf9256bf38e9c2e3cacda8c555f8c56 /zsh/aliases |
initial public commit
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" +} |