From 97299c39a1debd57e813fcdd33a5dffe0a96c341 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 18 Nov 2015 13:54:21 +0900 Subject: [PATCH] ftpane to ignore fzf pane --- Examples.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Examples.md b/Examples.md index 2223b67..0b5cb6d 100644 --- a/Examples.md +++ b/Examples.md @@ -354,13 +354,14 @@ fs() { ``` ```sh -# ftpane - switch pane -ftpane () { - local panes current_window target target_window target_pane +# ftpane - switch pane (@george-b) +ftpane() { + local panes current_window current_pane target target_window target_pane panes=$(tmux list-panes -s -F '#I:#P - #{pane_current_path} #{pane_current_command}') - current_window=$(tmux display-message -p '#I') + current_pane=$(tmux display-message -p '#I:#P') + current_window=$(tmux display-message -p '#I') - target=$(echo "$panes" | fzf) || return + target=$(echo "$panes" | grep -v "$current_pane" | fzf +m --reverse) || return target_window=$(echo $target | awk 'BEGIN{FS=":|-"} {print$1}') target_pane=$(echo $target | awk 'BEGIN{FS=":|-"} {print$2}' | cut -c 1)