From f457a25dbd1106cf5e94b39bb0f0a84279ef5477 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Fri, 14 Oct 2022 22:07:00 +0200 Subject: [PATCH] Add option to send a pre command to tmux --- README.md | 9 +++++++++ plugin/tslime.vim | 3 +++ 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index ffc953a..8402584 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,15 @@ the pane in the current window with the largest height, put the following in you let g:tslime_autoset_pane = 1 ``` +If you want a command to be sent to tmux before your actual command, put the following +into your config: + +```vim +let g:tslime_pre_command = "C-c" +``` + +This example will empty whatever is in the prompt or put tmux into normal mode. + Setting Keybindings ------------------- diff --git a/plugin/tslime.vim b/plugin/tslime.vim index e027c30..b6ac67f 100644 --- a/plugin/tslime.vim +++ b/plugin/tslime.vim @@ -15,6 +15,9 @@ function! Send_keys_to_Tmux(keys) call Tmux_Vars() endif + if exists("g:tslime_pre_command") + call system("tmux send-keys -t " . s:tmux_target() . " " . g:tslime_pre_command) + endif call system("tmux send-keys -t " . s:tmux_target() . " " . a:keys) endfunction