Modify tmux config/setup, zsh, some nvim & skhd key mappings, etc

This commit is contained in:
2025-09-05 12:39:47 -05:00
committed by david
parent 759958b126
commit 891b605dbe
19 changed files with 107 additions and 38 deletions

View File

@@ -1,21 +0,0 @@
local omitted_dirs=(
$HOME
$DIR_HOME_BOX
$DIR_DEV
$DIR_GIT_PROJECTS
)
[[ ! ${omitted_dirs[(re)$(pwd)]} ]] &&
tmux new-window -d -n cmd &&
tmux rename-window $EDITOR &&
$EDITOR .
clear
## example template for custom override
# tmux new-window -d -n cmd
# tmux send-keys -t :cmd "echo 'in cmd'" c-M
# tmux new-window -d -n another
# tmux send-keys -t :another "echo 'in another'" c-M
# tmux rename-window $EDITOR
# $EDITOR .
# clear

View File

@@ -5,13 +5,15 @@ switch_to() {
}
hydrate() {
local tmux_hydrate_path="$DIR_SCRIPTS/.tmux-session-hydrate-default"
local tmux_hydrate_files_dir="$XDG_CONFIG_HOME/tmux/session-hydrate-files"
local tmux_hydrate_path="$tmux_hydrate_files_dir/.tmux-session-hydrate-default"
[[ $1 = "thinking" ]] && tmux_hydrate_path="$tmux_hydrate_files_dir/.tmux-session-hydrate-thinking"
[[ $1 = "listening" ]] && tmux_hydrate_path="$tmux_hydrate_files_dir/.tmux-session-hydrate-listening"
[[ -f $2/.tmux-session-hydrate ]] && tmux_hydrate_path="$2/.tmux-session-hydrate"
[[ -f $tmux_hydrate_path ]] && tmux send-keys -t $1 "source $tmux_hydrate_path" c-M
}
local name_regex="^\([-_A-Za-z0-9]*\):.*$"
local existing_sessions=$([[ -n $(pgrep tmux) ]] && tmux list-sessions | sed "s/$name_regex/\1/" || echo '')
local existing_sessions=$([[ -n $(pgrep tmux) ]] && tmux list-sessions || echo '')
local search_dirs=(
$DIR_HOME_BOX
$DIR_DEV
@@ -23,8 +25,10 @@ local target_path=''
[[ $# -eq 1 ]] && target_path=$1 ||
target_path=$(find $search_dirs -mindepth 1 -maxdepth 1 -type d | fzf)
if [[ $target_path = "find-existing" ]]; then target_name=$(echo $existing_sessions | fzf);
if [[ $target_path = "." ]]; then target_name=$(basename $(pwd)) && target_path=$(pwd);
elif [[ $target_path = "hub" ]]; then target_name="hub" && target_path="$HOME";
elif [[ $target_path = "thinking" ]]; then target_name="thinking" && target_path="$DIR_SCRATCH_NOTES";
elif [[ $target_path = "listening" ]]; then target_name="listening" && target_path="$DIR_MUSIC";
elif [[ -n $target_path ]]; then target_name=$(basename "$target_path" | tr . _);
fi