LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-15-2011, 06:47 AM   #1
casualzone
Member
 
Registered: Jan 2010
Posts: 189

Rep: Reputation: 15
autorefresh in vim


I use vim to open a text file which is generated by a application. How could I autorefresh the text file in the vim?
 
Old 06-15-2011, 07:24 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Vim does not automatically check and update the screen. Even if you would use autoread and/or checktime you still have to manually activate them and tell vim to load the cahnged file (if it has changed).

Have a look here: http://www.mail-archive.com/vim@vim.org/msg05900.html You do have to realize that if you made changes to the file, they will be lost once you refresh the page!

Although I don't know why you need this functionality I do wonder if you are using the correct tool for the job, vim is not meant to monitor files.

Anyway, hope this helps.
 
Old 06-15-2011, 07:24 AM   #3
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Rep: Reputation: 8
Use :edit to reload the current file. In this way you can reload or as you termed it "auto-refresh" the file in vim.
 
Old 06-15-2011, 09:32 AM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by casualzone View Post
I use vim to open a text file which is generated by a application. How could I autorefresh the text file in the vim?
That wouldn't make much sense, since you would lose all your changes when it "autorefreshes".

Maybe tail -f is what you're looking for?
 
Old 06-16-2011, 03:27 AM   #5
casualzone
Member
 
Registered: Jan 2010
Posts: 189

Original Poster
Rep: Reputation: 15
sorry for the confusion.

The application (simulator) will generate a file to show the job completion status like 10% 20% 30%....
I just want to monitor this to check what is the current status since the job is slow.

currently i got to re-open the file to see the status. I hope there is a command to auto-refresh the file i have open.
PS: I dont need to write/edit the file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Personalize and Optimize Vim editor using Packt’s new Vim 7.2 book LXer Syndicated Linux News 0 05-20-2010 10:20 PM
Switching from vim to vim -g from inside vim iDragoon Linux - Software 4 05-15-2009 11:46 AM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 04:26 PM
browser autorefresh stops at 4 am avirup dasgupta Fedora 0 02-06-2006 01:40 AM
autorefresh... spank Programming 2 04-10-2004 12:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration