2
1
Not sure which stack exchange group this question goes so please move to the correct one if this is the wrong one.
What's happening is if I highlight something with tabs/indents from one window/browser and want to paste it into vi, the formatting gets messed up.
For example, I have the following in another window that I want to copy:
"date_created" : "2013-06-06 21:12:31",
"netdriver_duplex" : "Full",
"mac_address" : "FA:16:3E:17:CC:E1",
"interfaces" : "eth0,sit0",
"processors" : null
After I highlight it and paste it in vi, I get the following:
"date_created" : "2013-06-06 21:12:31",
"netdriver_duplex" : "Full",
"mac_address" : "FA:16:3E:17:CC:E1",
"interfaces" : "eth0,sit0",
"processors" : null
Someone told me auto-indent is messing me up and to run
ESC-> :set noai
Copy/Paste stuff
ESC-> :set ai
but this gets tiring after a while. Is there a workaround when pasting tabbed lines in vi with autoindent set to on or do I have to turn off auto-indent, paste, turn ai back on every time?
Thanks in advance for your help.
yes, I'm using <ESC>i<Ctrl>V. I just tried <ESC>"+p but all it printed was :s in my vi window. =( <br/> I don't know if it makes a difference but I forgot to mention this is on a Mac. I just click on terminal and a unix terminal window opens up. From here, I run vi. <br/> would this be an instance where I have to use the * register that you mention above? How would I use it b/c I'm blinding using <ESC>"*p and that didn't work =) <br/> Thanks again for your help. – Classified – 2013-06-18T21:56:34.153
Everything I know about is is from
:help quoteplus
and:help quotestar
. It works for me on Linux, but I know nothing of Mac. – jpaugh – 2013-06-18T22:02:49.293If you can't find a good solution here, the people over at vim_use@googlegroups.com are smart as a tack. Some of them are even vim developers. – jpaugh – 2013-06-18T22:04:00.000
thx for your help and the tips. – Classified – 2013-06-20T18:20:07.327