Re: [Vim-latex-devel] coding standards?
Brought to you by:
srinathava,
tmaas
From: Srinath A. <sr...@fa...> - 2002-12-09 21:52:54
|
> 1. I think Srinath once asked me to use "tabs, not spaces" for > indenting. Does this mean that I should set 'ts' to 2, instead of > setting 'sts' and leaving 'ts' at 8? I am not really familiar with 'sts', but this is what works for me in my .vimrc: set ts=4 let &sw = &ts Hmmm... looking at 'sts', it looks like it fakes a tab with a mixture of spaces and tags. I dont think I like that. I would definitely prefer all leading indentation to be strictly tabs. This way (and AFAIK it is the only way) people who like different indent levels can view the file according to the 'ts' value they prefer. Also, apart from the leading indentation being in tabs, none of the other indentation should be in tabs. I use the following mapping for tab which does both these things. (this was posted by Michael Geddes). -------------------------%<------------------------- imap <tab> <c-r>=<SID>InsertSmartTab()<cr> fun! s:InsertSmartTab() if strpart(getline('.'),0,col('.')-1) =~'^\s*$' return "\<Tab>" endif let ts = &ts let sp=(virtcol('.') % &sw) if sp==0 let sp = &sw endif return strpart(" ",0,1+ts-sp) endfun -------------------------%<------------------------- I have been meaning to extend this idea for the <bs> key too, but keep putting it off... > 2. Some files have change logs at the top. Is this left over from > pre-CVS days, or do we want to update these? Yes. They are leftovers. Please remove them as you see fit. > 3. Should we try for consistent time stamps? If so, is there a script > for updating them? Or should we let CVS take care of that, and stop > cluttering the diff files with changed time stamps? > I didn't think much about this. I would think that letting cvs deal with this would be a better idea. I dont know much about how to do it though via cvs though... For now, Mikolaj and me use lastchange.vim from: http://vim.sourceforge.net/script.php?script_id=259 > 4. Does anyone feel strongly about the number of columns and 'wrap' > versus 'nowrap'? Hmm... Haven't thought about this. But if you feel strongly about it, please let us know. Someplaces in envmacros.vim, where looong macros are defined, its cleaner to have 'nowrap' and have the whole thing be on a single line, imo. But inside the code itself, everything within 78 columns is best. I myself have 'nowrap' in my .vimrc and try to restrict all my actual code to within 78 cols. -- Srinath Avadhanula Dec 9 1:31pm I'm N-ary the tree, I am, N-ary the tree, I am, I am. I'm getting traversed by the parser next door, She's traversed me seven times before. And ev'ry time it was an N-ary (N-ary!) Never wouldn't ever do a binary. (No sir!) I'm 'er eighth tree that was N-ary. N-ary the tree I am, I am, N-ary the tree I am. |