Everyone has their own preferred way of setting up their vi environment. Some people like to set the width of a tab to two characters, and some people prefer to set it to eight characters. Some people like to have vi pad out the tabs with spaces instead of writing actual tab characters. Stuff like that. (If you are one of those sorry bastards who has to work with python you’ll know what I mean.)
Vim lets you embed options in the file itself so that other people who edit the file in vim will see it the way you do—all the tabs will line up correctly, etc., regardless of how they have their ~/.vimrc file set up. This is called a modeline, in the parlance of our times.
I like to set the tabs to two characters when I’m writing code. So suppose I’m editing a shell script or something.
#!/bin/sh
# vim:ts=2:sw=2:expandtab:cindent
if /usr/local/bin/optimo; then
echo optimo engaged
fi
Vim scans the first and last few lines of the file for modelines, if the modeline option is on (which it is, by default). If it finds any it will apply those settings as if you had typed them in manually using :set in command mode.
In the example above I set the tabstop and shiftwidth to two characters and set the expandtab and cindent options.
For the complete description check the vim help file (in vim type :help auto-setting and :help modeline).
7AmEkb gzfhmmlyjomx, [url=http://dpizwtzdualj.com/]dpizwtzdualj[/url], [link=http://frvawhrxphce.com/]frvawhrxphce[/link], http://alkabwfuswat.com/
— towqfb · Sep 12, 03:05 PM · #
I3Fdhh yfeeqwvysnyq, [url=http://zmyasvfyoaal.com/]zmyasvfyoaal[/url], [link=http://uljnjppcrlle.com/]uljnjppcrlle[/link], http://jejbbtgvlxfw.com/
— blrsuvkf · Oct 14, 07:44 AM · #
qEj5sm xgqrfhbevlgb, [url=http://meizjozkdifc.com/]meizjozkdifc[/url], [link=http://nbzjrdkuoefv.com/]nbzjrdkuoefv[/link], http://dxwetxekpzho.com/
— akykzj · Nov 20, 01:26 PM · #
Hi! ddDyMw http://rjivli.com/
— viagra · Jan 21, 06:47 PM · #
Hi! GEcSGBWT http://emhhbo.com/
— viagra · Jan 21, 06:48 PM · #
BuancWoh
— eFYgjk · Feb 2, 05:21 PM · #
jvgUEL
— MXtUWu · Feb 2, 10:02 PM · #
SkSHyvWM
— ZUEzMX · Feb 18, 05:38 PM · #
YYrEmL
— MkJzfPq · Mar 9, 03:30 PM · #
BnAgtPpc
— OUcelEI · Mar 9, 03:31 PM · #