Browse Source

feat: add tmux-sessionizer

master
Tovi Jaeschke-Rogers 8 months ago
parent
commit
75118befd9
7 changed files with 53 additions and 20 deletions
  1. +0
    -1
      .config/tmux/plugins/tmux
  2. +0
    -1
      .config/tmux/plugins/tmux-sensible
  3. +0
    -1
      .config/tmux/plugins/tmux-tokyo-night
  4. +0
    -1
      .config/tmux/plugins/tpm
  5. +25
    -0
      .local/bin/tmux-sessionizer
  6. +25
    -16
      .tmux.conf
  7. +3
    -0
      .zshrc

+ 0
- 1
.config/tmux/plugins/tmux

@ -1 +0,0 @@
Subproject commit a556353d60833367b13739e660d4057a96f2f4fe

+ 0
- 1
.config/tmux/plugins/tmux-sensible

@ -1 +0,0 @@
Subproject commit 25cb91f42d020f675bb0a2ce3fbd3a5d96119efa

+ 0
- 1
.config/tmux/plugins/tmux-tokyo-night

@ -1 +0,0 @@
Subproject commit ee73d4a9ba6222d7d51492a4e0e797c9249a879c

+ 0
- 1
.config/tmux/plugins/tpm

@ -1 +0,0 @@
Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946

+ 25
- 0
.local/bin/tmux-sessionizer View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
if [[ $# -eq 1 ]]; then
selected=$1
else
selected=$(find ~/Projects ~/go/src/git.tovijaeschke.xyz ~/ -mindepth 1 -maxdepth 1 -type d | fzf)
fi
if [[ -z $selected ]]; then
exit 0
fi
selected_name=$(basename "$selected" | tr . _)
tmux_running=$(pgrep tmux)
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
tmux new-session -s $selected_name -c $selected
exit 0
fi
if ! tmux has-session -t=$selected_name 2> /dev/null; then
tmux new-session -ds $selected_name -c $selected
fi
tmux switch-client -t $selected_name

.config/tmux/tmux.conf → .tmux.conf View File


+ 3
- 0
.zshrc View File

@ -36,6 +36,9 @@ SAVEHIST=$HISTSIZE
# Beep on error
setopt BEEP
export PATH="~/.local/bin/:$PATH"
export PATH="~/dotfiles/.local/bin/:$PATH"
# Use keycodes (generated via zkbd) if present, otherwise fallback on
# values from terminfo
if [[ -r ${ZDOTDIR:-$HOME}/.zkbd/${TERM}-${VENDOR} ]] ; then


Loading…
Cancel
Save