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
15
examples.md
15
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"
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user