From d935fb466b41d410579bd2248ff5f8faaca5a052 Mon Sep 17 00:00:00 2001 From: Von Welch Date: Sun, 11 Jun 2017 21:11:15 -0400 Subject: [PATCH 1/2] No need to wrap tmux escape codes starting with 2.5 Per https://github.com/ConradIrwin/vim-bracketed-paste/issues/32 --- plugin/bracketed-paste.vim | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/plugin/bracketed-paste.vim b/plugin/bracketed-paste.vim index 196ec9b..315a3cb 100644 --- a/plugin/bracketed-paste.vim +++ b/plugin/bracketed-paste.vim @@ -9,23 +9,8 @@ " Docs on mapping fast escape codes in vim " http://vim.wikia.com/wiki/Mapping_fast_keycodes_in_terminal_Vim -if !exists("g:bracketed_paste_tmux_wrap") - let g:bracketed_paste_tmux_wrap = 1 -endif - -function! WrapForTmux(s) - if !g:bracketed_paste_tmux_wrap || !exists('$TMUX') - return a:s - endif - - let tmux_start = "\Ptmux;" - let tmux_end = "\\\" - - return tmux_start . substitute(a:s, "\", "\\", 'g') . tmux_end -endfunction - -let &t_ti .= WrapForTmux("\[?2004h") -let &t_te .= WrapForTmux("\[?2004l") +let &t_ti .= "\[?2004h" +let &t_te .= "\[?2004l" function! XTermPasteBegin(ret) set pastetoggle= From a7f61f4407a4ad70df190e6eb6317636738eb004 Mon Sep 17 00:00:00 2001 From: Von Welch Date: Wed, 14 Jun 2017 21:15:23 -0400 Subject: [PATCH 2/2] Use t_SI and t_SE instead of t_ti and t_te See https://github.com/ConradIrwin/vim-bracketed-paste/issues/32#issuecomment-308299355 --- plugin/bracketed-paste.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/bracketed-paste.vim b/plugin/bracketed-paste.vim index 315a3cb..d5c692a 100644 --- a/plugin/bracketed-paste.vim +++ b/plugin/bracketed-paste.vim @@ -9,8 +9,8 @@ " Docs on mapping fast escape codes in vim " http://vim.wikia.com/wiki/Mapping_fast_keycodes_in_terminal_Vim -let &t_ti .= "\[?2004h" -let &t_te .= "\[?2004l" +let &t_SI .= "\[?2004h" +let &t_EI .= "\[?2004l" function! XTermPasteBegin(ret) set pastetoggle=