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:
#!/usr/bin/perl
# vim: set expandtab:
use strict;
This would tell Vim to expand tabs in the current file. See :help modeline for more info.
Friday, January 9, 2009
Subscribe to:
Post Comments (Atom)
4 comments:
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.
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.
Thanks.
Casey
@Anonymous
Try :history
Travis
I suggest people check out the securemodelines plugin:
http://www.vim.org/scripts/script.php?script_id=1876
Post a Comment