@ -269,7 +269,7 @@ alias df="df -h"
alias free = "free -m"
alias free = "free -m"
alias grep = "grep --color=auto"
alias grep = "grep --color=auto"
alias open = "xdg-open"
alias open = "xdg-open"
alias ag = "ag -i"
#transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
#transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
#tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }
#tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }
@ -373,7 +373,7 @@ fh() {
# fkill - kill process
# fkill - kill process
fkill( ) {
fkill( ) {
local pid
local pid
pid = $( ps -ef | sed 1d | fzf -m | awk '{print $2}' )
pid = $( ps -ef | grep -v ^root | sed 1d | fzf -m | awk '{print $2}' )
if [ " x $pid " != "x" ]
if [ " x $pid " != "x" ]
then
then
@ -411,3 +411,24 @@ z() {
#alias lp="lpass show -c --password $(lpass ls | fzf | awk '{print $(NF)}' | sed 's/\]//g')"
#alias lp="lpass show -c --password $(lpass ls | fzf | awk '{print $(NF)}' | sed 's/\]//g')"
gcbr( ) {
result = $( git branch -a --color= always | grep -v '/HEAD\s' | sort |
fzf --height 50% --border --ansi --tac --preview-window right:70% \
--preview 'git log --oneline --graph --date=short --pretty="format:%C(auto)%cd %h%d %s" $(sed s/^..// <<< {} | cut -d" " -f1) | head -' $LINES |
sed 's/^..//' | cut -d' ' -f1)
if [ [ $result != "" ] ] ; then
if [ [ $result = = remotes/* ] ] ; then
git checkout --track $( echo $result | sed 's#remotes/##' )
else
git checkout " $result "
fi
fi
}
gfs( ) {
git -c color.status= always status --short |
fzf --height 50% --border --ansi --multi --ansi --nth 2..,.. \
--preview '(git diff --color=always -- {-1} | sed 1,4d; cat {-1}) | head -500' |
cut -c4- | sed 's/.* -> //'
}