From acbead5efb781f1f911db7a437f1bbf6a1f8c624 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Wed, 31 Aug 2022 17:09:40 +0200 Subject: [PATCH] Add script and alacritty keybinding for z with fzf --- alacritty/alacritty.yml | 3 ++- zsh/custom-plugins/fzf-z.zsh | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 zsh/custom-plugins/fzf-z.zsh diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml index 261b941..dfb4221 100644 --- a/alacritty/alacritty.yml +++ b/alacritty/alacritty.yml @@ -737,7 +737,8 @@ theme: vscode.dark # # If the same trigger is assigned to multiple actions, all of them are executed # in the order they were defined in. -#key_bindings: +key_bindings: +- { key: Z, mods: Control, chars: "fzf-z \x0D" } #- { key: Paste, action: Paste } #- { key: Copy, action: Copy } #- { key: L, mods: Control, action: ClearLogNotice } diff --git a/zsh/custom-plugins/fzf-z.zsh b/zsh/custom-plugins/fzf-z.zsh new file mode 100644 index 0000000..d9b5c1d --- /dev/null +++ b/zsh/custom-plugins/fzf-z.zsh @@ -0,0 +1,6 @@ +#!/usr/bin/zsh + +fzf-z() { + dir=$(z | fzf --tiebreak=index --tac | sed -E 's/^[0-9]+[[:space:]]+//') + cd $dir +}