vimtricks.wiki Concise Vim tricks, one at a time.

How do you set per-file Vim settings using modelines?

Answer

// vim: set ts=2 sw=2 et:

Explanation

Add a modeline comment at the beginning or end of a file. Vim reads it and applies the settings. Enable with set modeline. Format varies by language.

Next

How do I visually select a double-quoted string including the quotes themselves?