Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Search Forums:



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 !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-29-2010
Registered User
 

Join Date: Jun 2010
Posts: 17
Thanks: 12
Thanked 0 Times in 0 Posts
In vi, any way to prevent :edit from repositioning the screen?

I am working on a project where I need to make many changes to files, both inside and outside of the vi editor. I make small changes manually right in vi, and I have a script that I run from another session that I use to make bigger changes to the files using sed.

After running my script from another session, I go back to my vi session and I refresh the screen by typing ":edit" so I can see the changes. That works; ":edit" does refresh the screen, but it puts me several lines above - or several lines below - where I was.

Any way to refresh without losing my spot?
Sponsored Links
    #2  
Old 07-30-2010
Registered User
 

Join Date: Jun 2007
Posts: 308
Thanks: 35
Thanked 5 Times in 5 Posts
You can use esc mode command to refresh the screen (reedit) discarding unsaved changes from the last saved session

Code:
:e!

Sponsored Links
    #3  
Old 07-30-2010
Registered User
 

Join Date: Jun 2010
Posts: 17
Thanks: 12
Thanked 0 Times in 0 Posts
Isn't e: the same thing as edit:? Is there a way to refresh without repositioning the screen?
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Virtual screen accessed by Screen Sharing linge OS X (Apple) 0 04-13-2009 03:00 PM
How to prevent /dev/rmt* re-assignments jwholey AIX 5 03-30-2008 09:26 AM
Locking a file when using VI to prevent multiple-edit sessions by diff users Browser_ice AIX 14 11-23-2006 09:43 AM
Prevent ftp usage NineInch AIX 1 03-03-2006 11:16 PM
how to prevent deadlock on this... yimab Programming 5 10-11-2005 08:57 PM



All times are GMT -4. The time now is 03:28 AM.