summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTill Höppner2017-05-15 14:34:02 +0200
committerTill Höppner2017-05-15 14:34:02 +0200
commit6e144bcba48c7fd7a707693874a9bb311afd2c33 (patch)
tree43b9166c5d6817f01312f22a0fcd846a06dc69f4
parentd027cc4db3c84e0333b1b3136484b412a2f86a67 (diff)
downloadzsh-6e144bcba48c7fd7a707693874a9bb311afd2c33.tar.gz
zsh-6e144bcba48c7fd7a707693874a9bb311afd2c33.tar.xz
zsh-6e144bcba48c7fd7a707693874a9bb311afd2c33.zip
Add fuzzy cd/locate/kill
-rw-r--r--functions/fd3
-rw-r--r--functions/fkill7
-rw-r--r--functions/fl3
3 files changed, 13 insertions, 0 deletions
diff --git a/functions/fd b/functions/fd
new file mode 100644
index 0000000..16f54d6
--- /dev/null
+++ b/functions/fd
@@ -0,0 +1,3 @@
+# fda - including hidden directories
+local dir
+dir=$(find ${1:-.} -type d 2> /dev/null | fzf +m) && cd "$dir"
diff --git a/functions/fkill b/functions/fkill
new file mode 100644
index 0000000..799fdbe
--- /dev/null
+++ b/functions/fkill
@@ -0,0 +1,7 @@
+local pid
+pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}')
+
+if [ "x$pid" != "x" ]
+then
+ echo $pid | xargs kill -${1:-9}
+fi
diff --git a/functions/fl b/functions/fl
new file mode 100644
index 0000000..d73a525
--- /dev/null
+++ b/functions/fl
@@ -0,0 +1,3 @@
+# fda - including hidden directories
+local dir
+dir=$(locate / | fzf +m) && cd "$dir"