Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary tmux-specific code #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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