blob: 790d6d460b41240465c7b9d457f7b4d110a983c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
sessionizer() {
DIR=$(fdfind --type d --strip-cwd-prefix -L -H | fzf)
SESSION_NAME="$DIR_$(date +%M%S)"
if [ -n "$DIR" ]
then
if [ "$1" == "-cd" ]
then
cd $DIR
return
fi
tmux new-session -d -c "$DIR" -s "$SESSION_NAME"
if [ -n "$TMUX" ]
then
tmux switch -t "$SESSION_NAME"
else
tmux attach -t "$SESSION_NAME"
fi
fi
}
bind '"\C-f": "sessionizer\n"'
bind '"\C-F": "sessionizer -cd\n"'
|