If you work on multiple projects which have different source code formatting conventions, vim's modelines can be useful. They allow a file to specify vim options which should be set when that file is loaded, such as options relating to the treatment of tabs. However, enabling modelines can be risky if you are editing files written by other people. Furthermore, maintaining a particular modeline across all the source files in a project is an aggravating but necessary task.
Today I wrote a little solution to this problems which I call "dirmode". It is a vim plugin which provides a feature somewhat like modelines, except that the options are stored in a separate file and affect all files in the directory where the options file is located.
The plugin is already usable and useful, albeit under-documented. I do have plans for some improvements, which you can read about in my to-do list. Also, have a look at the source if you are interested.
0 comments:
Post a Comment