[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] Coding w/ vim



Matthias Richter <post-an@matthias-richter.de> wrote:
>Cameron Matheson wrote on Sat Jun 02, 2001 at 03:45:30PM:
>> 2. How do I set the tab-spacing?  I like to code w/ two-space tab-stops,
>> but vim defaults to 8 :(
>
>set tabstop=2
>set expandtabs
>
>this expands tabs (which is a good idea IMHO) and sets stop to 2.

For the sake of variety, I prefer something like:

  set softtabstop=2 shiftwidth=2 noexpandtab

... and leave tabstop the way it is. This inserts tabs instead of eight
spaces behind the scenes where appropriate, but tab and
backspace-over-tab work as expected.

All of the syntax highlighting requires the vim-rt (runtime) package to
be installed.

You can use things like 'set comments', 'set cinkeys', and 'set
cinoptions' to do some really quite cool auto-formatting stuff. See the
respective :help sections.

-- 
Colin Watson                                     [cjw44@flatline.org.uk]



Reply to: