diff options
author | David Morgan <djm_uk@protonmail.com> | 2022-12-02 12:23:32 +0000 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2022-12-02 12:23:32 +0000 |
commit | 39cd18a854056bf950b308719d0f6cb569ccb213 (patch) | |
tree | 68edf56dd669a875e5ccfd7af9697f7cbc36c683 /nix-conf/home/includes/zsh.nix | |
parent | c4a71cbc90b8ce101fbdca64231fb6536d8e9c0d (diff) | |
download | dotfiles-39cd18a854056bf950b308719d0f6cb569ccb213.tar.gz |
Add some fzf functions
Diffstat (limited to 'nix-conf/home/includes/zsh.nix')
-rw-r--r-- | nix-conf/home/includes/zsh.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nix-conf/home/includes/zsh.nix b/nix-conf/home/includes/zsh.nix index 5c463c3..d69e4c2 100644 --- a/nix-conf/home/includes/zsh.nix +++ b/nix-conf/home/includes/zsh.nix @@ -136,6 +136,15 @@ stty -ixon function generate () { gopass generate -s -p $1 $((RANDOM % 14 + 45)) } + function fcd { cd $(fd -L --max-depth=''${1:-1} --type=d 2>/dev/null | fzf-tmux) } + + fif() { + if [ ! "$#" -gt 0 ]; then + echo "usage: fif <SEARCH_TERM>" + return 1; + fi + rg --files-with-matches --no-messages "$1" | fzf $FZF_PREVIEW_WINDOW --preview "rg --ignore-case --pretty --context 10 '$1' {}" + } tre () { command tre "$@" -e && source "/tmp/tre_aliases_$USER" 2>/dev/null; } |