diff --git a/Examples.md b/Examples.md index 75259bb..1788c2c 100644 --- a/Examples.md +++ b/Examples.md @@ -666,6 +666,22 @@ ftags() { ### tmux +```zsh +# zsh; needs setopt re_match_pcre. You can, of course, adapt it to your own shell easily. +tmuxkillf () { + local sessions + sessions="$(tmux ls|fzf --exit-0 --multi)" || return $? + local i + for i in "${(f@)sessions}" + do + [[ $i =~ '([^:]*):.*' ]] && { + echo "Killing $match[1]" + tmux kill-session -t "$match[1]" + } + done +} +``` + ```sh # tm - create new tmux session, or switch to existing one. Works from within tmux too. (@bag-man) # `tm` will allow you to select your tmux session via fzf.