Skip to content

Instantly share code, notes, and snippets.

@naranyala
Last active September 8, 2023 00:49
Show Gist options
  • Save naranyala/2a96168da9d98201bc15046f2c53cd30 to your computer and use it in GitHub Desktop.
Save naranyala/2a96168da9d98201bc15046f2c53cd30 to your computer and use it in GitHub Desktop.
#/bin/bash
### modal to switch tmux-session ###
tmux list-sessions -F '#S' |\
awk 'BEGIN {ORS=" "} {print $1, NR, "\"switch-client -t", $1 "\""}' |\
xargs tmux display-menu -T "Switch-session"
### bind inside tmux.conf ###
# unbind s
# unbind " "
# bind-key " " run-shell -b "eval 'bash $HOME/bin/tmux-switch-session.sh'"
### bonus ###
# use <leader><leader> to show neovim-harpoon-menu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment