tags:

views:

571

answers:

2

I would like to set some vim options in one file in the comments section.

For example, I would like to set this option in one file

set syntax=python

The file does not have a .py extension and I am not interested in making my vim installation recognise all files with this extension as python files.

I know this can be done because I have seen it, but my googling for this has not yet been fruitful.

+8  A: 

You're wanting a modeline The linked article should explain far better than I can.

Harper Shelby
+1  A: 

I haven't used vim much, but I think what you want is to add a line like the following to the end of your file:

# vim: set syntax=python
Ben Blank