Thread: [Vim-latex-devel] coding standards?
Brought to you by:
srinathava,
tmaas
From: Benji F. <be...@me...> - 2002-12-09 16:16:09
|
What are our coding standards? 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? 2. Some files have change logs at the top. Is this left over from pre-CVS days, or do we want to update these? 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? 4. Does anyone feel strongly about the number of columns and 'wrap' versus 'nowrap'? --Benji |
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. |
From: Benji F. <be...@me...> - 2002-12-13 14:21:19
|
Srinath Avadhanula wrote: > >>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? >> > For now, Mikolaj and me use lastchange.vim from: > > http://vim.sourceforge.net/script.php?script_id=259 The strftime() function is not standard. :-( On my Linux system, strftime('%Z') returns "EST", so I replaced let timezone = substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g') with let timezone = strftime('%Z') You might want to change the posted version to let timezone = strftime('%Z') if has("win32") let timezone = substitute(...) endif --Benji |
From: Mikolaj M. <mi...@wp...> - 2002-12-09 23:21:34
|
On Mon, Dec 09, 2002 at 11:20:20AM -0500, Benji Fisher wrote: > What are our coding standards? > 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? Some time ago Srinath asked me to add this settings to modelines in lS files: ts=4:sw=4:noet:fdm=marker > 2. Some files have change logs at the top. Is this left over from > pre-CVS days, or do we want to update these? It is rather leftover. I would rather stick with CVS logs. > 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 am using lastchange.vim by Srinath (it is somewhere on vim-online). I'd like to save them. It is useful with playing off-line before commiting changes to repository. > 4. Does anyone feel strongly about the number of columns and 'wrap' > versus 'nowrap'? I know. Long lines are ugly but in Vim it is easier to maintain single looong line than many short lines. Of course if I am a minority... Mikolaj |