On Fri, Jun 30, 2006 at 01:41:57PM +0200, tosch wrote:
> Hi,
>
> i'm using vim for viewing logfiles, because vims syntaxhighlighting
> gives me a quick and good overview on any messages.
>
> When the log-file is modified by an external application, vim notices
> that and prompts a W11-warning. If i now push the file-read-button,
> the file is reloaded. All syntaxhighlighting remains as it was before.
> So far so fine.
>
> If i explicitly want to reload the current file with :edit or :view,
> all syntaxhighlighting disappears. How can i achieve the same behavior
> as above ? I looked all over the vim-documentation, but couldn'd find
> anything appropriate.
>
> Any suggestions or hints ?
>
> Thanks in advance and regards, Thomas
How does vim know that you are viewing a logfile? Is the file type
detected automatically, or do you have to set it manually?
1. If the file type is detected automatically when you first start to
edit a logfile, then it should also be detected (and syntax highlighting
set appropriately) when you re-load. Perhaps
:2verbose e!
will give a clue to the problem.
2. I think this is more likely. If you have to set the file type
manually, then re-load the file, vim will try to guess its file type and
replace your choice with some default. In this case,
:noa e!
should do the trick.
:help autocmd-disable
HTH --Benji Fisher