Friday, January 9, 2009


Vim allows you to insert modelines to specify options you'd like for a specific file. For example, you could have a perl script as follows:

# vim: set expandtab:
use strict;

This would tell Vim to expand tabs in the current file. See :help modeline for more info.


egypt said...

Keep in mind that vim has had a number of command execution vulnerabilities through modelines in the past. For safety's sake it might be a good idea to disable modelines altogether.

Anonymous said...

Off topic, but how do you list all of the recent commands made at the colon prompt? I know I've seen this before on this blog, but can't find it.



Travis Whitton said...


Try :history


Anonymous said...

I suggest people check out the securemodelines plugin: