From dc08beffb4b468a71e4ce6d530106a69b9efc177 Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Wed, 5 Jan 2022 11:05:51 +0100 Subject: [PATCH 01/20] sh: Add option to target one particular tmux pane --- sh/tmuxcomplete | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sh/tmuxcomplete b/sh/tmuxcomplete index ca88bf3..67b5e3d 100644 --- a/sh/tmuxcomplete +++ b/sh/tmuxcomplete @@ -6,6 +6,10 @@ # Words visible in current window, excluding current pane # sh tmuxcomplete -e # +# Words visible in specified pane in current window +# (can't be used alongside the -e option) +# sh tmuxcomplete -t +# # Words visible in current session # sh tmuxcomplete -l '-s' # @@ -35,21 +39,23 @@ fi EXCLUDE='0' NOSORT='0' +TARGET='-1' PATTERN='' SPLITMODE=words LISTARGS='' CAPTUREARGS='' GREPARGS='' -while getopts enp:s:l:c:g: name +while getopts enp:s:t:l:c:g: name do case $name in e) EXCLUDE="1";; n) NOSORT="1";; # internal/undocumented, don't use, might be changed in the future + t) TARGET="$OPTARG";; p) PATTERN="$OPTARG";; s) SPLITMODE="$OPTARG";; l) LISTARGS="$OPTARG";; c) CAPTUREARGS="$OPTARG";; g) GREPARGS="$OPTARG";; - *) echo "Usage: $0 [-p pattern] [-s splitmode] [-l listargs] [-c captureargs] [-g grepargs]\n" + *) echo "Usage: $0 [-t ] [-p pattern] [-s splitmode] [-l listargs] [-c captureargs] [-g grepargs]\n" exit 2;; esac done @@ -64,6 +70,9 @@ excludecurrent() { # echo 1>&2 'current' "$currentpane" # use -F to match $ in session id grep -v -F "$currentpane" + elif ! [ "$TARGET" = "-1" ]; then + targetpane=$(tmux display-message -p '01-#{session_id} ')$TARGET + grep -F "$targetpane" else cat fi From c110afa02f24ea8c6d304f9abe6ed5ccd25087cd Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Wed, 5 Jan 2022 11:21:47 +0100 Subject: [PATCH 02/20] sh: Func sortu() to keep duplicate lines if NOSORT --- sh/tmuxcomplete | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sh/tmuxcomplete b/sh/tmuxcomplete index 67b5e3d..e9726ca 100644 --- a/sh/tmuxcomplete +++ b/sh/tmuxcomplete @@ -164,7 +164,7 @@ splitwords() { sortu() { if [ "$NOSORT" = "1" ]; then - uniq + cat else sort -u fi From 4413f49ee7855d1ac38fa06b1b6c3ba186f1cbee Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Wed, 5 Jan 2022 12:48:05 +0100 Subject: [PATCH 03/20] Add functions to capture pane to buffer (needs integrating) --- autoload/tmuxcomplete.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/autoload/tmuxcomplete.vim b/autoload/tmuxcomplete.vim index 09176f8..49a32e7 100644 --- a/autoload/tmuxcomplete.vim +++ b/autoload/tmuxcomplete.vim @@ -133,4 +133,24 @@ function! tmuxcomplete#gather_candidates() return tmuxcomplete#completions('', s:capture_args, 'words') endfunction +function! DisplayTmuxPaneIndices(duration) + " bring up the pane numbers as a background job + call job_start(["tmux", "display-pane", "-d", a:duration]) +endfunction + +function! TmuxPaneToBuffer() + call DisplayTmuxPaneIndices("350") + " get the input from user + let targetpane = input("target_pane:") + if targetpane =~ '\d\+' + silent execute 'split .tmux_pane_'.targetpane + silent execute '%!sh ~/linux_config_files/bin/tmuxcomplete.sh -t '.targetpane.' -s lines -n' + set filetype=bash + setlocal buftype=nofile + setlocal bufhidden=hide + setlocal noswapfile + setlocal nobuflisted + endif +endfunction + call tmuxcomplete#init() From 4ed010736baadcf74cc0f0188a53bfb2b71d24c4 Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Wed, 5 Jan 2022 13:51:28 +0100 Subject: [PATCH 04/20] Name new functions correctly: plugin#function() --- autoload/tmuxcomplete.vim | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/autoload/tmuxcomplete.vim b/autoload/tmuxcomplete.vim index 49a32e7..d302fb7 100644 --- a/autoload/tmuxcomplete.vim +++ b/autoload/tmuxcomplete.vim @@ -133,13 +133,13 @@ function! tmuxcomplete#gather_candidates() return tmuxcomplete#completions('', s:capture_args, 'words') endfunction -function! DisplayTmuxPaneIndices(duration) +function! tmuxcomplete#display_tmux_pane_indices(duration) " bring up the pane numbers as a background job call job_start(["tmux", "display-pane", "-d", a:duration]) endfunction -function! TmuxPaneToBuffer() - call DisplayTmuxPaneIndices("350") +function! tmuxcomplete#tmux_pane_to_buffer() + call tmuxcomplete#display_tmux_pane_indices("350") " get the input from user let targetpane = input("target_pane:") if targetpane =~ '\d\+' @@ -152,5 +152,3 @@ function! TmuxPaneToBuffer() setlocal nobuflisted endif endfunction - -call tmuxcomplete#init() From 6128c1291262f30bdef5ed05edcb4c093105c9d8 Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Wed, 5 Jan 2022 14:26:04 +0100 Subject: [PATCH 05/20] Use s:script variable for path to script --- autoload/tmuxcomplete.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/tmuxcomplete.vim b/autoload/tmuxcomplete.vim index d302fb7..38747c3 100644 --- a/autoload/tmuxcomplete.vim +++ b/autoload/tmuxcomplete.vim @@ -144,7 +144,7 @@ function! tmuxcomplete#tmux_pane_to_buffer() let targetpane = input("target_pane:") if targetpane =~ '\d\+' silent execute 'split .tmux_pane_'.targetpane - silent execute '%!sh ~/linux_config_files/bin/tmuxcomplete.sh -t '.targetpane.' -s lines -n' + silent execute '%!sh '.s:script.' -t '.targetpane.' -s lines -n' set filetype=bash setlocal buftype=nofile setlocal bufhidden=hide From 5137f0fbe5d0e1cf8319728038b8567436394dc1 Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Wed, 5 Jan 2022 14:26:39 +0100 Subject: [PATCH 06/20] Just echo target pane rather than grepping for it --- sh/tmuxcomplete | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sh/tmuxcomplete b/sh/tmuxcomplete index e9726ca..0a8e2ea 100644 --- a/sh/tmuxcomplete +++ b/sh/tmuxcomplete @@ -71,8 +71,7 @@ excludecurrent() { # use -F to match $ in session id grep -v -F "$currentpane" elif ! [ "$TARGET" = "-1" ]; then - targetpane=$(tmux display-message -p '01-#{session_id} ')$TARGET - grep -F "$targetpane" + echo $(tmux display-message -p '01-#{session_id} ')$TARGET else cat fi From d3ec897e4e6d2c708d239fb6944fdd97eaa966ad Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Wed, 5 Jan 2022 14:50:58 +0100 Subject: [PATCH 07/20] Add global option for tmux pane index display --- autoload/tmuxcomplete.vim | 4 +++- plugin/tmuxcomplete.vim | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/tmuxcomplete.vim b/autoload/tmuxcomplete.vim index 38747c3..ee43bc9 100644 --- a/autoload/tmuxcomplete.vim +++ b/autoload/tmuxcomplete.vim @@ -139,7 +139,9 @@ function! tmuxcomplete#display_tmux_pane_indices(duration) endfunction function! tmuxcomplete#tmux_pane_to_buffer() - call tmuxcomplete#display_tmux_pane_indices("350") + if g:tmuxcomplete_pane_index_display_duration_ms > 0 + call tmuxcomplete#display_tmux_pane_indices(g:tmuxcomplete_pane_index_display_duration_ms) + endif " get the input from user let targetpane = input("target_pane:") if targetpane =~ '\d\+' diff --git a/plugin/tmuxcomplete.vim b/plugin/tmuxcomplete.vim index fd82dbb..a0b5281 100644 --- a/plugin/tmuxcomplete.vim +++ b/plugin/tmuxcomplete.vim @@ -24,6 +24,9 @@ function! s:init() if exists('g:loaded_compe') lua require'compe'.register_source('tmux', require'compe_tmux') endif + + let g:tmuxcomplete_pane_index_display_duration_ms = "350" + endfunction call s:init() From 0f01ffe82d513a01acf1a2824f637b1fd34418a5 Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Wed, 5 Jan 2022 15:11:06 +0100 Subject: [PATCH 08/20] Fix Accidental deletion of tmuxcomplete#init()... --- autoload/tmuxcomplete.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autoload/tmuxcomplete.vim b/autoload/tmuxcomplete.vim index ee43bc9..d094b16 100644 --- a/autoload/tmuxcomplete.vim +++ b/autoload/tmuxcomplete.vim @@ -154,3 +154,5 @@ function! tmuxcomplete#tmux_pane_to_buffer() setlocal nobuflisted endif endfunction + +call tmuxcomplete#init() From a52273d8ae8b6e5b1208d7a94822c71c3bd29166 Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Wed, 5 Jan 2022 15:17:15 +0100 Subject: [PATCH 09/20] Add comment in script for global user option --- plugin/tmuxcomplete.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/tmuxcomplete.vim b/plugin/tmuxcomplete.vim index a0b5281..5f834b7 100644 --- a/plugin/tmuxcomplete.vim +++ b/plugin/tmuxcomplete.vim @@ -25,6 +25,7 @@ function! s:init() lua require'compe'.register_source('tmux', require'compe_tmux') endif + " for use with tmuxcomplete#tmux_pane_to_buffer() let g:tmuxcomplete_pane_index_display_duration_ms = "350" endfunction From 694039c0b414f860f7eb29cf06040ff85e7fd4b6 Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Wed, 5 Jan 2022 18:37:32 +0100 Subject: [PATCH 10/20] Add description and usage of new functionality --- README.md | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ccc6fdd..739090a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # tmux-complete.vim -Vim plugin for insert mode completion of words in adjacent tmux panes +Vim plugin for insert mode completion of words in adjacent tmux panes and +duplicating the contents of a visible tmux pane in a split buffer. ## Motivation @@ -8,13 +9,18 @@ If you're using Vim in tandem with Tmux you might be familiar with this pesky situation: You're happily editing your lovely files in Vim, when you notice you need to -type a word that you can see in a different Tmux pane right next to Vim. This -might be some secret key found in your REPL or the name of a failing test. +type a word, or a chunk of text, that you can see in a different Tmux pane +right next to Vim. This might be some secret key found in your REPL or the name +of a failing test. -Usually the interesting text is too short to warrant switching panes and going -into Tmux' copy mode, so you end typing it out again. +Usually the interesting text is too short, to warrant switching panes and going +into Tmux's copy mode, so you end up typing it out again. -## But fear no longer! +Or maybe You just don't like using Tmux's copy mode, period. You feel like that +chunk of text sitting in a distant Tmux pane ought to be just as accessible to +you as a chunk of text sitting in a Vim buffer. + +## Well, fear no longer! This plugin adds a completion function that puts all words visible in your Tmux panes right under your fingertips. Just enter insert mode, start typing any @@ -32,6 +38,15 @@ MacVim! [example]: https://raw.githubusercontent.com/wellle/images/master/tmux-complete-example.png [gvim]: https://raw.githubusercontent.com/wellle/images/master/gvim-complete.png +There is also a function that copies all the text visible in a particular tmux +pane directly into a new split buffer in your Vim instance! + +Simply call the function, and specify the pane you want: +![][example_pane_to_buffer_before] + +And it's right there, ready to be bent to Vim's will: +![][example_pane_to_buffer_after] + ## Third party integration Tmux complete is automatically integrated with the following plugins: @@ -196,3 +211,18 @@ tmux-complete by putting one of these lines into your `.vimrc`: The trigger function itself is named `tmuxcomplete#complete` (in case you want to call it manually). + +- When copying the text in a Tmux pane to a Vim buffer, Tmux is instructed to +briefly flash the pane indexes for 350ms to aid in your choice. To disable this +behavior, put this in your .vimrc: + + ```vim + let g:tmuxcomplete_pane_index_display_duration_ms = 0 + ``` + +- Or set it to a different duration: + + ```vim + let g:tmuxcomplete_pane_index_display_duration_ms = "1000" + ``` + From ab6588afdeacc1f097e4a93504a53e85217e0e9f Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Wed, 5 Jan 2022 18:38:29 +0100 Subject: [PATCH 11/20] Fix accidental file name change --- tmuxcomplete | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 tmuxcomplete diff --git a/tmuxcomplete b/tmuxcomplete new file mode 100644 index 0000000..0a8e2ea --- /dev/null +++ b/tmuxcomplete @@ -0,0 +1,185 @@ +#!/bin/sh + +# Usage: Get a list of all words visible in current window +# sh tmuxcomplete +# +# Words visible in current window, excluding current pane +# sh tmuxcomplete -e +# +# Words visible in specified pane in current window +# (can't be used alongside the -e option) +# sh tmuxcomplete -t +# +# Words visible in current session +# sh tmuxcomplete -l '-s' +# +# Words visible in all sessions +# sh tmuxcomplete -l '-a' +# +# Words containing 'foo' +# sh tmuxcomplete -p 'foo' +# +# List of lines +# sh tmuxcomplete -s lines +# +# Words containing 'foo', ignoring case +# sh tmuxcomplete -p 'foo' -g '-i' +# +# Words beginning with 'foo' +# sh tmuxcomplete -p '^foo' +# +# Words including 2000 lines of history per pane +# sh tmuxcomplete -c '-S -2000' + +if ! tmux info > /dev/null 2>&1; then + echo "[tmux-complete.vim]" + echo "No tmux found!" + exit 0 +fi + +EXCLUDE='0' +NOSORT='0' +TARGET='-1' +PATTERN='' +SPLITMODE=words +LISTARGS='' +CAPTUREARGS='' +GREPARGS='' +while getopts enp:s:t:l:c:g: name +do case $name in + e) EXCLUDE="1";; + n) NOSORT="1";; # internal/undocumented, don't use, might be changed in the future + t) TARGET="$OPTARG";; + p) PATTERN="$OPTARG";; + s) SPLITMODE="$OPTARG";; + l) LISTARGS="$OPTARG";; + c) CAPTUREARGS="$OPTARG";; + g) GREPARGS="$OPTARG";; + *) echo "Usage: $0 [-t ] [-p pattern] [-s splitmode] [-l listargs] [-c captureargs] [-g grepargs]\n" + exit 2;; +esac +done + +listpanes() { + tmux list-panes $LISTARGS -F '#{pane_active}#{window_active}-#{session_id} #{pane_id}' +} + +excludecurrent() { + if [ "$EXCLUDE" = "1" ]; then + currentpane=$(tmux display-message -p '11-#{session_id} ') + # echo 1>&2 'current' "$currentpane" + # use -F to match $ in session id + grep -v -F "$currentpane" + elif ! [ "$TARGET" = "-1" ]; then + echo $(tmux display-message -p '01-#{session_id} ')$TARGET + else + cat + fi +} + +paneids() { + cut -d' ' -f2 +} + +capturepanes() { + panes=$(cat) + if [ -z "$panes" ]; then + # echo 'no panes' 1>&2 + return + elif tmux capture-pane -p >/dev/null 2>&1; then + # tmux capture-pane understands -p -> use it + echo "$panes" | xargs -n1 tmux capture-pane $CAPTUREARGS -p -t + else + # tmux capture-pane doesn't understand -p (like version 1.6) + # -> capture to paste-buffer, echo it, then delete it + echo "$panes" | xargs -n1 -I{} sh -c "tmux capture-pane $CAPTUREARGS -t {} && tmux show-buffer && tmux delete-buffer" + fi +} + +split() { + if [ "$SPLITMODE" = "ilines,words" ]; then + # this is most reabable, but not posix compliant + # tee >(splitilines) >(splitwords) + + # from https://unix.stackexchange.com/a/43536 + # this has some issues with trailing whitespace sometimes + # tmp_dir=$(mktemp -d) + # mkfifo "$tmp_dir/f1" "$tmp_dir/f2" + # splitilines <"$tmp_dir/f1" & pid1=$! + # splitwords <"$tmp_dir/f2" & pid2=$! + # tee "$tmp_dir/f1" "$tmp_dir/f2" + # rm -rf "$tmp_dir" + # wait $pid1 $pid2 + + splitilinesandwords + elif [ "$SPLITMODE" = "lines" ]; then + splitlines + elif [ "$SPLITMODE" = "ilines" ]; then + splitilines + elif [ "$SPLITMODE" = "words" ]; then + splitwords + fi +} + +splitilinesandwords() { + # print full line to duplicate it + # on the duplicate substitute all spaces with newlines + # duplicate that result again + # in that duplicate replace all non word characters by linebreaks + sed -e 'p;s/[[:space:]]\{1,\}/\ + /g;p;s/[^a-zA-Z0-9_]\{1,\}/\ + /g' | + # remove surrounding non-word characters + grep -o "\\w.*\\w" +} + +splitlines() { + # remove surrounding whitespace + grep -o "\\S.*\\S" +} + +splitilines() { + # starts at first word character + grep -o "\\w.*\\S" +} + +# returns both WORDS and words of each given line +splitwords() { + # use sed like this instead of tr? + # substitute all spaces with newlines + # duplicate that line + # in the duplicate replace all non word characters by linebreaks + # sed -e 's/[[:space:]]\{1,\}/\ + # /g;p;s/[^a-zA-Z0-9_]/ /g;s/[[:space:]]\{1,\}/\ + # /g' | + + # copy lines and split words + sed -e 'p;s/[^a-zA-Z0-9_]/ /g' | + # split on spaces + tr -s '[:space:]' '\n' | + # remove surrounding non-word characters + grep -o "\\w.*\\w" +} + +sortu() { + if [ "$NOSORT" = "1" ]; then + cat + else + sort -u + fi +} + +# list all panes +listpanes | +# filter out current pane +excludecurrent | +# take the pane id +paneids | +# capture panes +capturepanes | +# split words or lines depending on splitmode +split | +# filter out items not matching pattern +grep -e "$PATTERN" $GREPARGS | +# sort and remove duplicates +sortu From 195a295ce4d6a6c4ad1781bf6743ca3ae2a11125 Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Wed, 5 Jan 2022 23:56:14 +0100 Subject: [PATCH 12/20] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 739090a..b67ee11 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,13 @@ There is also a function that copies all the text visible in a particular tmux pane directly into a new split buffer in your Vim instance! Simply call the function, and specify the pane you want: -![][example_pane_to_buffer_before] + +![pane_selection](https://user-images.githubusercontent.com/52209396/148301300-c4b002d6-6362-4e81-b1a0-52277088a51c.jpg) + And it's right there, ready to be bent to Vim's will: -![][example_pane_to_buffer_after] + +![pane_2](https://user-images.githubusercontent.com/52209396/148301308-2f8db950-498c-442c-84e4-d354f94dbcec.jpg) ## Third party integration From 59f1bdf6b2aca9c9e487d47d9a8fe14c865ff120 Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Thu, 6 Jan 2022 00:06:14 +0100 Subject: [PATCH 13/20] Show how to map the tmux_pane_to_buffer function --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b67ee11..1702408 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,15 @@ MacVim! There is also a function that copies all the text visible in a particular tmux pane directly into a new split buffer in your Vim instance! -Simply call the function, and specify the pane you want: +Simply call the function, or map it to something: + +``` +:call tmuxcomplete#tmux_pane_to_buffer() + +nnoremap t :call tmuxcomplete#tmux_pane_to_buffer() +``` + +, and specify the pane you want: ![pane_selection](https://user-images.githubusercontent.com/52209396/148301300-c4b002d6-6362-4e81-b1a0-52277088a51c.jpg) @@ -223,7 +231,7 @@ behavior, put this in your .vimrc: let g:tmuxcomplete_pane_index_display_duration_ms = 0 ``` -- Or set it to a different duration: +- Or set it to a different duration (as a string): ```vim let g:tmuxcomplete_pane_index_display_duration_ms = "1000" From e3fb432b421ed693c5ad95efa539f35a0218643b Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Thu, 6 Jan 2022 00:11:40 +0100 Subject: [PATCH 14/20] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1702408..9868331 100644 --- a/README.md +++ b/README.md @@ -41,11 +41,15 @@ MacVim! There is also a function that copies all the text visible in a particular tmux pane directly into a new split buffer in your Vim instance! -Simply call the function, or map it to something: +Simply call the function like so: -``` +```vim :call tmuxcomplete#tmux_pane_to_buffer() +``` + + Or map it to something convienient: +```vim nnoremap t :call tmuxcomplete#tmux_pane_to_buffer() ``` From a7d5a7bb816d58a067381955a86b32f0dc0f70d1 Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Thu, 6 Jan 2022 00:15:15 +0100 Subject: [PATCH 15/20] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9868331..1f9c4f3 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Simply call the function like so: nnoremap t :call tmuxcomplete#tmux_pane_to_buffer() ``` -, and specify the pane you want: +After the function is called, the tmux pane indices are flashed for a brief moment. Then just type the number to specify the pane you want: ![pane_selection](https://user-images.githubusercontent.com/52209396/148301300-c4b002d6-6362-4e81-b1a0-52277088a51c.jpg) From 0af8be6d920f16175a04a3cba953e9a575dcd8cf Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Thu, 6 Jan 2022 00:16:20 +0100 Subject: [PATCH 16/20] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1f9c4f3..9d18616 100644 --- a/README.md +++ b/README.md @@ -53,12 +53,12 @@ Simply call the function like so: nnoremap t :call tmuxcomplete#tmux_pane_to_buffer() ``` -After the function is called, the tmux pane indices are flashed for a brief moment. Then just type the number to specify the pane you want: +After the function is called, the tmux pane indices are flashed for a brief moment. Then just type the number to specify the pane you want and hit enter: ![pane_selection](https://user-images.githubusercontent.com/52209396/148301300-c4b002d6-6362-4e81-b1a0-52277088a51c.jpg) -And it's right there, ready to be bent to Vim's will: +Here I typed '2', ad it's right there, ready to be bent to Vim's will: ![pane_2](https://user-images.githubusercontent.com/52209396/148301308-2f8db950-498c-442c-84e4-d354f94dbcec.jpg) From 952c45b7dba519d061605a400f7db6b4cb931247 Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Thu, 6 Jan 2022 12:59:28 +0100 Subject: [PATCH 17/20] test --- test | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test diff --git a/test b/test new file mode 100644 index 0000000..e69de29 From c2cd587e34cca1eebbae909dc05686647bdb2bdf Mon Sep 17 00:00:00 2001 From: Matthew Bennett Date: Thu, 6 Jan 2022 12:59:58 +0100 Subject: [PATCH 18/20] rm test --- test | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test diff --git a/test b/test deleted file mode 100644 index e69de29..0000000 From 7dcfddf7f76836aee343ba4336861157c8f7d2b2 Mon Sep 17 00:00:00 2001 From: Matt-A-Bennett Date: Fri, 12 Aug 2022 16:59:20 +0200 Subject: [PATCH 19/20] Don't overide user g:tmuxcomplete_pane_index_display_duration_ms --- plugin/tmuxcomplete.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/tmuxcomplete.vim b/plugin/tmuxcomplete.vim index 5f834b7..8db37e3 100644 --- a/plugin/tmuxcomplete.vim +++ b/plugin/tmuxcomplete.vim @@ -25,8 +25,10 @@ function! s:init() lua require'compe'.register_source('tmux', require'compe_tmux') endif - " for use with tmuxcomplete#tmux_pane_to_buffer() - let g:tmuxcomplete_pane_index_display_duration_ms = "350" + if exists('g:tmuxcomplete_pane_index_display_duration_ms') + " for use with tmuxcomplete#tmux_pane_to_buffer() + let g:tmuxcomplete_pane_index_display_duration_ms = "350" + endif endfunction From f8a522762ef53eafbe84f87856c7ec9bdd1a54a9 Mon Sep 17 00:00:00 2001 From: Matt-A-Bennett Date: Fri, 12 Aug 2022 17:04:11 +0200 Subject: [PATCH 20/20] tmp --- plugin/tmuxcomplete.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/tmuxcomplete.vim b/plugin/tmuxcomplete.vim index 8db37e3..a29ba4d 100644 --- a/plugin/tmuxcomplete.vim +++ b/plugin/tmuxcomplete.vim @@ -25,7 +25,7 @@ function! s:init() lua require'compe'.register_source('tmux', require'compe_tmux') endif - if exists('g:tmuxcomplete_pane_index_display_duration_ms') + if !exists('g:tmuxcomplete_pane_index_display_duration_ms') " for use with tmuxcomplete#tmux_pane_to_buffer() let g:tmuxcomplete_pane_index_display_duration_ms = "350" endif