Re: A secure, configurable alternative to modelines
- Ciaran McCreesh wrote:
> I've written a script that reimplements a restricted form ofVery interesting script - thanks.
> modelines as .vim code rather than internals:
A quick overview for anyone interested:
- Include 'set nomodeline' in your vimrc.
- Use Ciaran's plugin which will set modeline options.
The plugin scans the first 5 and the last 5 lines of each
buffer (in BufRead). It parses any modeline, and executes code
to set options which you have allowed. But it is only capable
of doing certain very restricted things, and so is very safe.
For example, it can set textwidth or tabstop etc. Any other
setting is ignored (or shows a warning in verbose mode).
Your script is very helpful and I will try it. However, as you
would be painfully aware, it doesn't cover awkward cases like
using Vim on another computer, or making a mistake and executing
a Vim without your normal vimrc.