vimrc

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules

commit c133064805c2bc42d1bb263ae2cfdb62c550f8ec
parent 44aef27d3c6773517debe52af6e5af4576f1b311
Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe>
Date:   Tue, 31 Oct 2023 18:01:26 -0500

update

Diffstat:
Aplugin/pablo/tmux.vim | 37+++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+), 0 deletions(-)

diff --git a/plugin/pablo/tmux.vim b/plugin/pablo/tmux.vim @@ -0,0 +1,37 @@ +function TmuxSendText(text) abort + call TmuxSendKeys(shellescape(substitute(a:text, '\n$', ' ', ''))) +endfunction + +function TmuxSendKeys(keys) abort + call system('tmux send-keys -t {marked} '.a:keys) +endfunction + +function TmuxSendNormal(type) + try + let a_save = @a + if a:type == 'line' + silent exe "normal! '[V']".'"ay' + call TmuxSendText(@a) + call TmuxSendKeys("Enter") + elseif a:type == "char" + silent exe "normal! `[v`]".'"ay' + call TmuxSendText(@a) + endif + finally + let @a = a_save + set operatorfunc= + endtry +endfunction + +function TmuxSendVisual(visualmode) + try + let a_save = @a + silent exe "normal! `<".a:visualmode."`>".'"ay' + call TmuxSendText(@a) + if a:visualmode =~ '^V$' + call TmuxSendKeys("Enter") + endif + finally + let @a = a_save + endtry +endfunction