![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how i prepare a c++ code(c code) for implementing my own protocol format | amitpansuria | High Level Programming | 1 | 09-06-2007 08:09 PM |
| Sun's 'Project Copy Linux' not a Linux copy - Register | iBot | UNIX and Linux RSS News | 0 | 07-29-2007 02:31 AM |
| Copy code from shell | yohoshua | UNIX for Dummies Questions & Answers | 1 | 10-11-2006 11:20 PM |
| SSH key code versus server key code | Texan | Security | 1 | 04-12-2006 08:57 AM |
| Return code from PL/SQL Code | Shaz | UNIX for Advanced & Expert Users | 7 | 06-03-2003 07:56 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Copy code to vi
Hi,
whenever I copy a code to vi session from other script it just goes weird. It just goes across the whole screen and looks really bizzare If the code is small I can manually remove the tabs and indent it correctly but if it is 2000 lines it makes it really difficult. Is there something I can do about it and how can I copy efficiently without getting the code all over the place. Your help will be highly appreciated Thanks Rooh |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
if the text you are copying to a vi session is from a script, i would have the script dump its output to a file, then edit it like that.
ie: ./somescript > someoutputfile |
|
#3
|
||||
|
||||
|
Re: Copy code to vi
Quote:
Include the exact command you're using that's producing the undesirable results. |
|
#4
|
|||
|
|||
|
If you are using vim then you might get better results by doing ":se paste" before the paste operation. Remember to reset the setting i.e. ":se nopaste" when going back to normal editting.
mpty |
|
#5
|
||||
|
||||
|
Turn off autoindent with :set noai
or read-in the file using :r filename |
|
#6
|
|||
|
|||
|
Hi ,
Basically this is what I am doing. Suppose my .txt file looks like this Code:
# check that the file exists Say Hello all Do it correctly place it on the server Do all you can Save as much as you can Think for the rainy day Life is a bed of thorns and face it,either smilingly or you wet ur face vi tmp_rooh.ksh It looks like the one below *********************************************** Code:
# check that the file exists
Say Hello all
Do it correctly
place it on the server
Do all you can
Save as much as you can
Think for the rainy day
Life is a bed of thorns and face it,either smilingly or you w
et ur face
I want it to look exactly the same as the one in .txt and not like the one above. Hope this makes it a bit clear. If it just a few lines of code I can manually do it but there are codes of 1000's of lines and I need to copy them from the text file and put it on unix . Thanks Code tags added -- Perderabo Last edited by Perderabo; 03-12-2004 at 08:32 PM. |
|
#7
|
|||
|
|||
|
Heah Guys,
The code pasted in the second part has changed it's formatting in here. CAN YOU PLEASE TRY PASTING THE CODE ON YOUR VI session and hopefully you'll see what I mean as IT's formatting it here quiet well and thus I can't show you here. Thanks |
|||
| Google The UNIX and Linux Forums |