aboutsummaryrefslogtreecommitdiff
path: root/config/zsh/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'config/zsh/plugins')
-rw-r--r--config/zsh/plugins/fzf-cd.zsh12
-rw-r--r--config/zsh/plugins/output-operations.zsh19
2 files changed, 31 insertions, 0 deletions
diff --git a/config/zsh/plugins/fzf-cd.zsh b/config/zsh/plugins/fzf-cd.zsh
new file mode 100644
index 0000000..e4b4337
--- /dev/null
+++ b/config/zsh/plugins/fzf-cd.zsh
@@ -0,0 +1,12 @@
+fzf-change-dir() {
+ local result=$(find -type d | fzf);
+
+ if ! [[ -z "$result" ]]; then
+ cd "$result"
+ fi
+
+ zle send-break
+}
+
+zle -N fzf-change-dir;
+bindkey '^P' fzf-change-dir;
diff --git a/config/zsh/plugins/output-operations.zsh b/config/zsh/plugins/output-operations.zsh
new file mode 100644
index 0000000..e9b3546
--- /dev/null
+++ b/config/zsh/plugins/output-operations.zsh
@@ -0,0 +1,19 @@
+# TODO
+
+# logoutputdir=$(mktemp -d /tmp/zsh-output-operations.XXXXXXXX/)
+
+output-file() {
+ local termid=$(tty | sed 's|/|-|g');
+ echo "$logoutputdir/last-output-$termid";
+}
+
+xz() {
+ "$@" |& tee $(output-file);
+}
+
+# Cleanup
+function plugin-exit-handler {
+ rm -f $(output-file);
+}
+
+# trap plugin-exit-handler EXIT