diff options
author | Toby Vincent <tobyv13@gmail.com> | 2022-07-01 23:58:42 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2022-07-01 23:58:42 -0500 |
commit | d7cfbbf606261703d57a4cca4e3da1cd2f3a8f35 (patch) | |
tree | 16a20de00965388c8f889cc554241931806d4f92 /tmux/.local | |
parent | 5ff3e50aadda43712b98d76210042a924a3cd295 (diff) |
feat(tmux): add sorting and better filter for sessionizer
Diffstat (limited to 'tmux/.local')
-rwxr-xr-x | tmux/.local/bin/tmux-sessionizer | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tmux/.local/bin/tmux-sessionizer b/tmux/.local/bin/tmux-sessionizer index 30b547e..8750a4f 100755 --- a/tmux/.local/bin/tmux-sessionizer +++ b/tmux/.local/bin/tmux-sessionizer @@ -5,9 +5,10 @@ if [ "$#" -eq 1 ]; then else selected=$( find ~/src ~/.dotfiles -maxdepth 2 -type d,f -path '*/.git' -printf '%h\n' -prune | - xargs -I{} sh -c 'git -C "{}" rev-parse HEAD &>/dev/null && + xargs -I{} sh -c 'stat -c %Y:"{}" $XDG_DATA_HOME/nvim/sessions/$(echo "{}" | sed "s|/|%|g").vim || + (git -C "{}" rev-parse HEAD &>/dev/null && git -C "{}" --no-pager log -1 --all --format="%at:{}" 2>/dev/null || - stat -c %Y:"{}" "{}"/.git' | sort -r | cut -d':' -f2- | + stat -c %Y:"{}" "{}"/.git)' | sort -r | cut -d':' -f2- | fzf-tmux -p -- -d/ --with-nth -2.. --preview="exa --tree --icons --git-ignore {}" ) fi |