Add special case (hub) to tmux-sessionizer
This commit is contained in:
parent
11d224b396
commit
5208cd48ee
5
src_files/.config/git/ignore
Normal file
5
src_files/.config/git/ignore
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
.tool-versions
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
.tmux-session-hydrate
|
||||||
|
|
@ -4,6 +4,7 @@ local omitted_dirs=(
|
|||||||
$HOME
|
$HOME
|
||||||
$HOMEBOX
|
$HOMEBOX
|
||||||
$DEVDIR
|
$DEVDIR
|
||||||
|
$DEVDIR/git
|
||||||
)
|
)
|
||||||
[[ ! ${omitted_dirs[(re)$(pwd)]} ]] &&
|
[[ ! ${omitted_dirs[(re)$(pwd)]} ]] &&
|
||||||
tmux new-window -d -n cmd &&
|
tmux new-window -d -n cmd &&
|
||||||
|
@ -15,18 +15,22 @@ hydrate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local search_dirs=(
|
local search_dirs=(
|
||||||
$HOME
|
|
||||||
$HOMEBOX
|
$HOMEBOX
|
||||||
$DEVDIR
|
$DEVDIR
|
||||||
$DEVDIR/git
|
|
||||||
$DEVDIR/git/*
|
$DEVDIR/git/*
|
||||||
)
|
)
|
||||||
local selected_path=''
|
local selected_path=''
|
||||||
[[ $# -eq 1 ]] && selected_path=$1 ||
|
[[ $# -eq 1 ]] && selected_path=$1 ||
|
||||||
selected_path=$(find $search_dirs -mindepth 1 -maxdepth 1 -type d | fzf)
|
selected_path=$(
|
||||||
|
find $search_dirs -mindepth 1 -maxdepth 1 -type d |
|
||||||
|
(echo 'hub' && cat) |
|
||||||
|
fzf
|
||||||
|
)
|
||||||
[[ -z $selected_path ]] && exit 0
|
[[ -z $selected_path ]] && exit 0
|
||||||
|
|
||||||
local selected_name=$(basename "$selected_path" | tr . _)
|
local selected_name=''
|
||||||
|
[[ "$selected_path" = "hub" ]] && selected_name="hub" && selected_path=$HOME ||
|
||||||
|
selected_name=$(basename "$selected_path" | tr . _)
|
||||||
|
|
||||||
! (tmux_session_exists $selected_name) &&
|
! (tmux_session_exists $selected_name) &&
|
||||||
tmux new-session -d -s $selected_name -c $selected_path &&
|
tmux new-session -d -s $selected_name -c $selected_path &&
|
||||||
|
Loading…
Reference in New Issue
Block a user