From 45fb7f7b9a837de8e65f79424a856715725c8275 Mon Sep 17 00:00:00 2001 From: Noah Masur Date: Wed, 25 Nov 2020 12:14:44 -0500 Subject: [PATCH] more shortcuts for git and ps, and forgot typo --- bin/nuke | 13 +++++++++++++ fish.configlink/functions/aliases.fish | 2 +- fish.configlink/functions/gittools.fish | 12 ++++++++---- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100755 bin/nuke diff --git a/bin/nuke b/bin/nuke new file mode 100755 index 0000000..51d438d --- /dev/null +++ b/bin/nuke @@ -0,0 +1,13 @@ +#!/bin/sh + +nuke() { + local pid + pid=$(ps -ef | grep -v ^root | sed 1d | fzf -m | awk '{print $2}') + + if [ "x$pid" != "x" ] + then + echo $pid | xargs kill -${1:-9} + fi +} + +nuke diff --git a/fish.configlink/functions/aliases.fish b/fish.configlink/functions/aliases.fish index 280a77a..ecb2fca 100644 --- a/fish.configlink/functions/aliases.fish +++ b/fish.configlink/functions/aliases.fish @@ -15,7 +15,7 @@ function aliases --description 'All aliases' abbr -a tnn 'tmux new-session -s noah' # Git - abbr -a gs 'git status -sb' + abbr -a gs 'git status' abbr -a gd 'git diff' abbr -a gds 'git diff --staged' abbr -a ga 'git add' diff --git a/fish.configlink/functions/gittools.fish b/fish.configlink/functions/gittools.fish index a3355ae..b54caa8 100644 --- a/fish.configlink/functions/gittools.fish +++ b/fish.configlink/functions/gittools.fish @@ -15,17 +15,17 @@ function gittools function git-merge-fuzzy set branch (git-fuzzy-branch "merge from...") - and git merge + and git merge $branch end function git-delete-fuzzy set branch (git-fuzzy-branch "delete branch...") - and git branch -d + and git branch -d $branch end function git-force-delete-fuzzy set branch (git-fuzzy-branch "force delete branch...") - and git branch -D + and git branch -D $branch end function git @@ -49,7 +49,11 @@ function gittools return 1 end else - command git $argv + if count $argv > /dev/null + command git $argv + else + command git status -sb + end end end