Paste vim settings into file

In some files, I see a commented line, usually the last one, with vim settings. Wim read these settings? If so, are there any restrictions on what settings can be set by a person?

+43
vim
Oct 18 '10 at 10:54
source share
3 answers

They are called modelines, and while I'm not sure how much you can go with them, here is a link to the wimtips wiki with some examples:

http://vim.wikia.com/wiki/Modeline_magic

help modeline 

from inside vim to check white papers.

+44
Oct 18 '10 at 11:09
source share

This line of code:

 [other chars]<spaces>vim:<spaces>settings 

Put it in the first or last few lines of the file, note that it needs <spaces> . For example:

 # vim: tabstop=2 shiftwidth=2 expandtab 

In the short version:

 # vim: ts=2 sw=2 et 

Place one of the above lines in a file, on the top or bottom line. For more information, use the vim help:

 :h modeline 
+17
Oct 22 '13 at 9:17
source share
+8
Oct 18 '10 at 11:08
source share



All Articles