diff --git a/examples.md b/examples.md index 6419fe8..9767803 100644 --- a/examples.md +++ b/examples.md @@ -107,3 +107,18 @@ ftags() { -c "silent tag $(cut -f2 <<< "$line")" } ``` + +tmux +---- + +```sh +# fs [FUZZY PATTERN] - Select selected tmux session +# - Bypass fuzzy finder if there's only one match (--select-1) +# - Exit if there's no match (--exit-0) +fs() { + local session + session=$(tmux list-sessions -F "#{session_name}" | \ + fzf --query="$1" --select-1 --exit-0) && + tmux switch-client -t "$session" +} +``` \ No newline at end of file