Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to configure vim to enable 'modeline' (and by extension, setting 'modelines' to be non-zero), but restricting the parsing capability of modelines in files?

I want to enable setting of tabstops, softtabstops, and filetype in files, while keeping modelines otherwise disabled (for security cosiderations).

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You can use the vim plugin securemodelines : Secure, user-configurable modeline support to whitelist allowed commands in modelines. Note that the version on vim.org is 5 years old, the latest version of the plugin on github has some minor tweaks.

share|improve this answer
Thanks. This has exactly the features I was looking for. I had to learn about using vim plugins, which led me to the amazing Pathogen, which was followed by the even more amazing Vundle). –  scottbb Apr 27 '13 at 20:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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