1

I have a modeline in a file

# vim: set filetype=sshconfig :

This sets filetype correctly in vim, but when opening the file in vimdiff, the filetype is set to conf. How can I tell vimdiff to read the modeline?

I'm using Vim 7.4.258 from MacPorts on Mac OS X.

  • I can't reproduce this. With two files, one containing your modeline, vimdiff -N -u NONE file1 file2 always sets the 'filetype' correctly. I'm using Vim 7.4.729 on Fedora. – garyjohn Jun 17 '15 at 16:21
  • I can't reproduce with vimdiff either, 7.4.692 on Ubuntu. – muru Jun 17 '15 at 16:51
0

Tracked it down
I had installed vim-scripts/diffchar using Vundle, but it wasn't working so I commented it out and forgot about it. Running :PluginClean did the trick.

|improve this answer|||||
  • I use diffchar, and it didn't cause any problems reading from the modeline. O.o But then again, the plugin does work for me. – muru Jun 17 '15 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.