On Thursday 2013-01-03 20:02 -0500, Benjamin Smedberg wrote: > On 1/3/13 7:44 PM, Nicholas Nethercote wrote: > >Hi > > > >https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style > >says that mozilla code files should have the following Emacs and Vim > >mode lines: > > > > /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; > >c-basic-offset: 2 -*- */ > > /* vim: set ts=2 et sw=2 tw=80: */ > > > >AIUI, |tab-width| in Emacs and |ts| in Vim are equivalent -- they > >dictate how wide tabs that appear in files should appear. I can't see > >a good reason why they aren't the same value in the above lines. > I thought that "tab-width" was equivalent to "tw" and not "ts". In > any case, the purpose of tab-width: 8 is to make it obvious when > code has hard tabs and is mis-indented. I'd be willing to entertain > a larger value such as 17 or 23 ;-) But I really don't think we > should use 2, because it would be easier to introduce hard tabs into > a file by accident.
No, tw is shorthand for textwidth, which is the width at which text wraps. For example, I'm writing this email in vim with tw=68. ts is short for tabstop, which says that a tab character indents to the next column that is a multiple of the tabstop. (et is expandtab, saying that tabs should be expanded to spaces, and sw is shiftwidth, which is the indentation amount used for >, <, and other related things.) -David -- 𝄞 L. David Baron http://dbaron.org/ 𝄂 𝄢 Mozilla http://www.mozilla.org/ 𝄂 _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform