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.

When I copy text from an OS X GUI app (e.g. Firefox) and paste it into vim in my terminal, it's often missing the first few lines or characters, with no obvious pattern.

This may not be vim specific, but I've just tested pasting into the terminal when not using vim – e.g. when using the bash shell – and don't get them problem.

share|improve this question
1  
Have you enabled insert mode before? –  slhck Nov 11 '11 at 11:07
1  
(blush) Now you say it I'm not sure - maybe a simpleton like me should stick to the likes of nano. I'll answer my question myself to help future simpletons who'll doubtless Google something similar. –  tog22 Nov 11 '11 at 12:10
    
Low rep means I have to wait 8 hours so here's the answer I'll paste in then: This was quickly answered in comments: >Have you enabled insert mode before? – slhck 1 hour ago >(blush) Now you say it I'm not sure - maybe a simpleton like me should stick to the likes of nano. I'll answer my question myself to help future simpletons [edit: no offence] who'll doubtless Google something similar. – tog22 just now I presume this is the answer, and the lack of an obvious pattern was due to a lag in vim responding to the 'i' character being pasted in. –  tog22 Nov 11 '11 at 12:15
    
You can also use MacVim. It has better support for Mac OS X. –  Eir Nym Nov 11 '11 at 13:22

1 Answer 1

up vote 7 down vote accepted

Just make sure that when pasting to vim, the Insert Mode is activated. Do this by pressing i before pasting.

Otherwise pasted characters like i or o will trigger insert mode and you'll miss everything before.

share|improve this answer
    
More succinct than my proposed answer in comments above! –  tog22 Nov 11 '11 at 13:14
1  
You may also want to :set paste before pasting so that special indenting triggers don't affect the text you're pasting. When you've finished, :set nopaste to go back to ordinary behavior. –  MikeSep Nov 11 '11 at 18:47

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.