From b85add6379ce6306b4db6fd313f19c8f2b78a704 Mon Sep 17 00:00:00 2001 From: NightMachinary <36224762+NightMachinary@users.noreply.github.com> Date: Wed, 4 Sep 2019 16:29:54 +0430 Subject: [PATCH] Updated Examples (markdown) --- Examples.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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.