Created
July 9, 2021 14:33
-
-
Save ScottGuthart/ed0f41f8bba65cda9f2d073c3f174559 to your computer and use it in GitHub Desktop.
Revisions
-
ScottGuthart created this gist
Jul 9, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ # You can put files here to add functionality separated per file, which # will be ignored by git. # Files on the custom/ directory will be automatically loaded by the init # script, in alphabetical order. # For example: add yourself some shortcuts to projects you often work on. # # brainstormr=~/Projects/development/planetargon/brainstormr # cd $brainstormr alias brew='env PATH=${PATH//$(pyenv root)\/shims:/} brew' alias cdw='~/workspace' # Attach to tmux # if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then # exec tmux new-session -A -s Default # fi # fkill - kill processes - list only the ones you can kill. Modified the earlier script. fkill() { local pid if [ "$UID" != "0" ]; then pid=$(ps -f -u $UID | sed 1d | fzf -m | awk '{print $2}') else pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}') fi if [ "x$pid" != "x" ] then echo $pid | xargs kill -${1:-9} fi } # fh - repeat history fh() { print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed -E 's/ *[0-9]*\*? *//' | sed -E 's/\\/\\\\/g') }