From af0bc24fe41409253fa48802a1065b6aa0425c87 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 27 Feb 2024 02:47:15 -0500 Subject: [PATCH] shells/zsh: add j and jh for jumping --- users/modules/global/shells/zsh.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/users/modules/global/shells/zsh.nix b/users/modules/global/shells/zsh.nix index 7feb9c4..33ed907 100644 --- a/users/modules/global/shells/zsh.nix +++ b/users/modules/global/shells/zsh.nix @@ -37,6 +37,16 @@ if [[ "$(basename "$(readlink "/proc/$PPID/exe")")" == ".kitty-wrapped" ]]; then PATH=$(echo "$PATH" | sed 's/\/nix\/store\/[a-zA-Z._0-9-]\+\/bin:\?//g' | sed 's/:$//') fi + + j() { + if [[ $# -eq 0 ]] then + \builtin cd -- "$(fd -H -t d | fzf)" + else + \builtin cd -- "$(fd -H -t d | fzf -1 -q "$@")" + fi + } + + alias "jh"="cd ~ && j" ''; dotDir = ".config/zsh";