diff --git a/scripts/scripts/tmux-sessionator b/scripts/scripts/tmux-sessionator index 817fdb6..f01a9bd 100755 --- a/scripts/scripts/tmux-sessionator +++ b/scripts/scripts/tmux-sessionator @@ -2,10 +2,30 @@ # Adapted from: https://github.com/ThePrimeagen/.dotfiles/blob/master/bin/.local/scripts/tmux-sessionizer +declare -a findPaths=("$HOME") + if [[ $# -eq 1 ]]; then selected=$1 else - selected=$(find ~/projects ~/ -mindepth 1 -maxdepth 1 -type d | fzf) + # Some of my machines, projects is a symlink to $REPOS, so ignore it. + # On other machines, it is local versions of projects, so add it. + if [[ ! -L "$HOME/projects" ]]; then + findPaths+="$HOME/projects" + fi + + if [[ -d "$REPOS/github.com" ]]; then + for dir in $(find "$REPOS/github.com" -mindepth 1 -maxdepth 1 -type d); do + # prepends to the array. + findPaths=($dir $findPaths) + done + fi + + if [[ -d "$REPOS/local" ]]; then + # prepends to the array. + findPaths=("$REPOS/local" $findPaths) + fi + + selected=$(find -L "${(@)findPaths}" -mindepth 1 -maxdepth 1 -type d | fzf) fi if [[ -z $selected ]]; then diff --git a/tmux/tmux.conf b/tmux/tmux.conf index bcf413f..59aea17 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -61,10 +61,6 @@ bind -n M-Left select-pane -L bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D -# bind -T prefix j select-pane -D -# bind -T prefix k select-pane -U -# bind -T prefix h select-pane -L -# bind -T prefix l select-pane -R bind-key -r K kill-pane # Use Shift-arrow keys to navigate windows.