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

vim-plug breaks auto paste script #819

Closed
4 of 11 tasks
vitmy0000 opened this issue Jan 18, 2019 · 1 comment
Closed
4 of 11 tasks

vim-plug breaks auto paste script #819

vitmy0000 opened this issue Jan 18, 2019 · 1 comment

Comments

@vitmy0000
Copy link

Looks like vim-plug will break the auto-paste script (https://coderwall.com/p/if9mda/automatically-set-paste-mode-in-vim-when-pasting-in-insert-mode)

I use vim with tmux, so I use the following script in my vimrc and it's pretty handy.

function! WrapForTmux(s)
  if !exists('$TMUX')
    return a:s
  endif

  let tmux_start = "\<Esc>Ptmux;"
  let tmux_end = "\<Esc>\\"

  return tmux_start . substitute(a:s, "\<Esc>", "\<Esc>\<Esc>", 'g') . tmux_end
endfunction

let &t_SI .= WrapForTmux("\<Esc>[?2004h")
let &t_EI .= WrapForTmux("\<Esc>[?2004l")

function! XTermPasteBegin()
  set pastetoggle=<Esc>[201~
  set paste
  return ""
endfunction

inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()

If my vimrc has only this, the auto-paste works.
But after I add only

call plug#begin('~/.vim/plugged')
call plug#end()

auto-paste stops working.

Not exactly sure what's the reason. But I guess it's a vim-plug related issue.
Can someone help on this?



  • Type:
    • Bug
    • Enhancement
    • Feature Request
    • Question
  • OS:
    • All/Other
    • Linux
    • OS X
    • Windows
  • Vim:
    • Terminal Vim
    • GVim
    • Neovim
@LukeAI
Copy link

LukeAI commented Jan 7, 2021

@vitmy0000 I have this problem - did you solve it?

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

No branches or pull requests

2 participants