In some files I can see a commented line, usually the last, with vim settings. Does vim read these settings? If it does, are any limitations of what kind of settings man can put there?
The global or system-wide vim configuration file is generally located under the /etc/vim/vimrc . This configuration file is applied to all users and when Vim is started this configuration file is read and Vim is configured according to this file contents.
Settings file used by Vim, a text editing program often used by source code developers and system administrators; saves the default settings for the editor when it is opened; allows users to customize options for the editor. VIMRC files are saved in a plain text format.
modelines allow you to set variables specific to a file. By default, the first and last five lines are read by vim for variable settings. For example, if you put the following in the last line of a C program, you would get a textwidth of 60 chars when editing that file: /* vim: tw=60 ts=2: */
They're called modelines and while I'm not sure the extent you can go with them, here's a link to the vimtips wiki with some examples:
http://vim.wikia.com/wiki/Modeline_magic
help modeline
from within vim to check out the official docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With