Skip to content

Secure alternative to Vim modelines. Maintained, active fork.

License

Notifications You must be signed in to change notification settings

ypcrts/securemodelines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

securemodelines

A secure alternative to Vim modelines

This is a maintained fork of the original vimscript.

Description

Vim's internal modeline support allows all sorts of annoying and potentially insecure options to be set. This script implements a much more heavily restricted modeline parser that permits only user-specified options to be set.

Installation

No configuration required. Using vim-plug

Plug 'ypcrts/securemodelines'

Internals

The g:secure_modelines_allowed_items array contains allowed options. See :help securemodelines_options for default values.

The g:secure_modelines_verbose variable, if set to something true, will make the script warn when a modeline attempts to set any other option.

The g:secure_modelines_modelines variable overrides the number of lines to check. By default it is 5.

If g:secure_modelines_leave_modeline is defined, the script will not clobber &modeline. Otherwise &modeline will be unset.

If b:disable_secure_modelines is defined, securemodelines will not run for the current buffer. The intent being to turn off securemodelines in an ftplugin.

Contributors

See the contributors graph.

About

Secure alternative to Vim modelines. Maintained, active fork.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published