Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I noticed that I have to be in insert mode in order to paste in vim using screen's shortcut C-a ] or C-a C-] otherwise I get garbled up (not necessarily garbage) output. I do not think this behavior caused by any specific prompt or shell because I have tested in both cygwin and in debian. Is this a problem that I cannot get around? Or is there a solution?

share|improve this question
    
This is true. What is your question? –  garyjohn Mar 9 '13 at 21:04
    
Sorry that my question was not clear. I just wanted to spare myself the extra key stroke every time I copy and paste. –  Forethinker Mar 9 '13 at 21:07
    
How exactly do you use Vim and screen? Are you working locally? Remotely? What do you paste? From where? –  romainl Mar 10 '13 at 9:02

2 Answers 2

The only solution I'm aware of is the screenpaste.vim plugin. It provides some new commands for pasting from screen that don't use many keystrokes.

share|improve this answer
    
This works well on regular linux distro, but not in cygwin; it shows that the buffer is empty. It seems as though the copying to buffer does not work correctly. A useful plugin nonetheless. –  Forethinker Mar 9 '13 at 22:26

I have never had good results pasting into vim WITHOUT being in insert mode, regardless of whether I'm using screen or not. For whatever reason, pasting from command mode seems to clip off the first few characters of copied text (where insert mode pastes the text as is). This being said, I've added both - set paste - and - syntax off - to a function in my vimrc and mapped that function to a key on my keyboard, so that I can toggle paste, and toggle syntax highlighting (which makes for better pasting). And on many X-based terminals (I use terminator) you can map ctrl+shift+V to paste. The process of cutting and pasting into vim is quick and easy this way, regardless of whether I'm using screen or not. Not sure if this was what you were looking for, but I hope this can be of some help.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.