diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-03-22 17:17:59 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-03-22 17:17:59 +0530 |
| commit | edc4ef0106f7d4a37d367e81ae9e6470dbdc7087 (patch) | |
| tree | 2e49381dbfec01b74d3b91bffc3c75e040742cef /config/zsh | |
| parent | 384f3554cc53cf03fa9a4cf9e1bfa74aaa64a13f (diff) | |
| download | nixos-config-edc4ef0106f7d4a37d367e81ae9e6470dbdc7087.tar.gz nixos-config-edc4ef0106f7d4a37d367e81ae9e6470dbdc7087.zip | |
chore: config sync
Diffstat (limited to 'config/zsh')
| -rw-r--r-- | config/zsh/plugins/fzf-cd.zsh | 12 | ||||
| -rw-r--r-- | config/zsh/plugins/output-operations.zsh | 19 |
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 |
