Use zoxide to provide paths to fzf
This commit is contained in:
parent
bad8b22a3b
commit
54fdbd71d9
12
bin/t
12
bin/t
|
@ -1,19 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Quickly navigate between different directories using fzf and tmux sessions
|
||||
# (Thanks, ThePrimeagen!).
|
||||
#
|
||||
# https://github.com/ThePrimeagen/.dotfiles/blob/master/bin/.local/bin/tmux-sessionizer
|
||||
# https://frontendmasters.com/workshops/dev-productivity
|
||||
|
||||
if [[ $# -eq 1 ]]; then
|
||||
selected=$1
|
||||
else
|
||||
# Get the session name from fuzzy-finding list of directories and generating a
|
||||
# tmux-safe version.
|
||||
items=$(find ~/Code -mindepth 3 -maxdepth 3 -type d ! -name .git)
|
||||
|
||||
selected=$(echo "${items}" | sort | fzf --reverse)
|
||||
selected=$(zoxide query -l | grep -v /tmp | grep -v "^${HOME}/\." | grep -v "^${HOME}/Code$" | grep -v "/main$" | fzf --reverse)
|
||||
fi
|
||||
|
||||
if [[ -z $selected ]]; then
|
||||
|
|
|
@ -31,6 +31,11 @@
|
|||
nix-direnv.enable = true;
|
||||
};
|
||||
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
home.sessionPath = [ "$HOME/.config/bin" ];
|
||||
|
||||
xdg.configFile."ripgrep/config".text = ''
|
||||
|
|
Loading…
Reference in a new issue