m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-20 17:43:42 -05:00

Add function fs to select tmux session by fuzzy name

Christian Wellenbrock
2014-06-12 03:38:32 -07:00
parent 1e2b604000
commit 2a8130d9d9

@@ -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"
}
```