Skip to content

Remove unnecessary tmux-specific code#25

Open
prashcr wants to merge 1 commit intoConradIrwin:masterfrom
prashcr:master
Open

Remove unnecessary tmux-specific code#25
prashcr wants to merge 1 commit intoConradIrwin:masterfrom
prashcr:master

Conversation

@prashcr
Copy link

@prashcr prashcr commented Sep 17, 2016

#24

@prashcr
Copy link
Author

prashcr commented Sep 17, 2016

I removed just the tmux stuff but there are still some differences between it and this snippet that works for me.

Could anyone shed light on what differences there are between the two scripts? Try using my script and let me know if there are any perceivable differences.

My script

" Auto-toggle paste mode for xterm
let &t_SI .= "\<Esc>[?2004h"
let &t_EI .= "\<Esc>[?2004l"
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
function! XTermPasteBegin()
  set pastetoggle=<Esc>[201~
  set paste
  return ""
endfunction

This plugin

let &t_ti .= "\<Esc>[?2004h"
let &t_te .= "\<Esc>[?2004l"

function! XTermPasteBegin(ret)
  set pastetoggle=<f29>
  set paste
  return a:ret
endfunction

execute "set <f28>=\<Esc>[200~"
execute "set <f29>=\<Esc>[201~"
map <expr> <f28> XTermPasteBegin("i")
imap <expr> <f28> XTermPasteBegin("")
vmap <expr> <f28> XTermPasteBegin("c")
cmap <f28> <nop>
cmap <f29> <nop>

@ryanpcmcquen
Copy link

ryanpcmcquen commented Aug 29, 2017

This works and solves all the tmux issues for me. I made it a plugin: https://github.com/ryanpcmcquen/fix-vim-pasting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants