How to stop file type changing automatically

marc gmane at auxbuss.com
Mon Aug 14 16:08:41 UTC 2006


Roshan Mansinghani said...
> On 8/13/06, marc <gmane at auxbuss.com> wrote:
> >
> > Heyho,
> >
> > My config file for gvim has been given the .html file type. This results
> > in it being opened by Firefox, when opened via a file manager. Not what
> > I want.
> >
> > Taking a closer look, this behaviour occurs when the file contain a
> > <script> entry. In other words, the file happily lives life as a text
> > file type until an edit is saved containing the text "<script>", when
> > it, immediately and without notification, automatically changes its file
> > type to .html
> >
> > How do I stop this from happening?
> >
> > It reminds me of Microsoft's Clippy - but rather worse - because it
> > doesn't tell me it's doing it, and it and doesn't give me the option top
> > stop it.
> >
> > For now, I've added a filename patterns to text/plain of .*, which might
> > well be sufficient.
> >
> > It also begs the question of when and where this changing is done.
> > Frankly, I can't conceive of a time when I'd want this behaviour.

> Does this happen only in gvim or if you use another editor (say, Kate) do
> you have the same problem?

Oh, it's not the editor. I can copy my (now protected) .gvimrc to 
another directory and, as soon as I rename it to gvimrc it "becomes" an 
HTML mime type. If I then rename it to gvimrc.txt, then it becomes a 
text/plain type again.

Try it. Create an empty text file called fred. Add some text and it will 
behave as a regular text file. Now, add the lines:

<script>
<script>

save it, and it's changed to an HTML file type. You can use any editor 
to do this. (If you only use one line containing <script>, then the type 
doesn't change. It knows what it's looking for :-) )

I thought that it might be associated with Desktop/Behaviour/File 
icons/Show icon previews, but I switched them off for text and HTML 
files and it still happens.

What is parsing files to cause this? I want it to stop!

-- 
Best,
Marc





More information about the kubuntu-users mailing list