You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Neels J. Hofmeyr" <ne...@elego.de> on 2008/10/07 04:04:56 UTC

Vim editor: automatic subversion-style indenting

Hi Vim users && subversion developers,

I just added this Vim Tip for automatic subversion coding style in Vim. The
advanced setup is found on the dev@ mailing list. The simpler setup isn't.
Any additions/improvements welcome.

http://vim.wikia.com/wiki/Subversion_developer_cindent_options

~Neels

-- 
Neels Hofmeyr -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23458696  mobile: +49 177 2345869  fax: +49 30 23458695
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelsreg: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194




Re: Vim editor: automatic subversion-style indenting

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Peter Samuelson wrote on Sat, 11 Oct 2008 at 19:32 -0500:
> [Daniel Shahaf]
> > > 1) Do you think your vim code would be of general interest for this?
> > 
> > The second and fourth sections (':SvnRediff' and 'svn:log') are
> > potentially useful.
> 
> OK, yeah, I'll probably edit it down to those 2 parts then.
> 

I thought I might as well leave the two "for working on Subversion
itself" sections in.  But they're already on this thread, maybe that's
good enough.

> Ah, sure.  I think it would just go to /usr/share/doc/subversion/examples/
> and people could just find it there and do what they want.

Cool.  The obvious problem is that the script would need a name...
Suggestions, anyone?


Daniel
(attaching a new version)

Re: Vim editor: automatic subversion-style indenting

Posted by Peter Samuelson <pe...@p12n.org>.
[Daniel Shahaf]
> > 1) Do you think your vim code would be of general interest for this?
> 
> Parts.  The first (and most of the fifth) sections[1] are primarily for
> Windows folks.  The third and sixth sections are only useful to people
> working on Subversion and APR themselves (they set up the coding style,
> install folding for STATUS, and run 'ctags' with some useful flags).  The
> second and fourth sections (':SvnRediff' and 'svn:log') are potentially
> useful.

OK, yeah, I'll probably edit it down to those 2 parts then.

> I can fix the packaging and standalone-ness, if there is interest; but
> please don't paint those excerpts as something they aren't.  

Ah, sure.  I think it would just go to /usr/share/doc/subversion/examples/
and people could just find it there and do what they want.

> I do have copyright on it.  The Apache License v2 works for you?

That's fine.
-- 
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/

Re: Vim editor: automatic subversion-style indenting

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Daniel Shahaf wrote on Thu, 9 Oct 2008 at 22:15 +0200:
> [2]  Most noticeably, I accidentally left in at least 2 calls to functions
> from my vimrc that aren't included in the file.  Sorry about that; I'll
> fix it.

Until I fix it, you can just comment out those calls.  They are the
calls to :MatchLongLines on line 61, to s:SID() on line 76, and to
s:_Linefeeds_MapF3ToScrollBy() on line 135.  None of them is essential.

Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Vim editor: automatic subversion-style indenting

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Peter Samuelson wrote on Thu, 9 Oct 2008 at 13:43 -0500:
> 
> [Daniel Shahaf]
> > This thread might be a good time to post the Subversion-related parts of 
> > my vimrc.  Attached.
> 
> I don't use vim, but I may be interested in shipping your vimrc bits as
> example code in Debian's subversion packages (we already ship psvn.el).
> 

Thanks for your interest.

> 1) Do you think your vim code would be of general interest for this?
> 

Parts.  The first (and most of the fifth) sections[1] are primarily for
Windows folks.  The third and sixth sections are only useful to people
working on Subversion and APR themselves (they set up the coding style,
install folding for STATUS, and run 'ctags' with some useful flags).  The
second and fourth sections (':SvnRediff' and 'svn:log') are potentially
useful.

':SvnRediff' opens a buffer on 'svn diff' output and remembers the 'svn
diff' invocation, and the 'svn:log' section sets up an autocommand that,
when 'svn ci' is run (without -m or -F), splits a window on the diff being
committed.


The comparison to the 301KB psvn.el is flattering.  Those 57 lines don't
even have a name and are not packaged as a standalone script (they make
some assumptions[2] about their environment).  They don't attempt to be
a general-purpose Subversion package, either; they are nothing more or
less than two sections of code that I have found useful.

I can fix the packaging and standalone-ness, if there is interest; but
please don't paint those excerpts as something they aren't.  

> 2) Assuming you have copyright on your file (i.e., you wrote it, and
>    not "on company time"), could you declare a copyright and a license
>    grant?  Either by adding comments to the vimrc file, or just via
>    email if you prefer.
> 

I do have copyright on it.  The Apache License v2 works for you?


Thanks,

Daniel

[1]  'Section' starts in a line starting with exactly two double quotes.
Open the file in Vim and you'll see...

[2]  Most noticeably, I accidentally left in at least 2 calls to functions
from my vimrc that aren't included in the file.  Sorry about that; I'll
fix it.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Vim editor: automatic subversion-style indenting

Posted by Peter Samuelson <pe...@p12n.org>.
[Daniel Shahaf]
> This thread might be a good time to post the Subversion-related parts of 
> my vimrc.  Attached.

I don't use vim, but I may be interested in shipping your vimrc bits as
example code in Debian's subversion packages (we already ship psvn.el).

1) Do you think your vim code would be of general interest for this?

2) Assuming you have copyright on your file (i.e., you wrote it, and
   not "on company time"), could you declare a copyright and a license
   grant?  Either by adding comments to the vimrc file, or just via
   email if you prefer.
-- 
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Vim editor: automatic subversion-style indenting

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Neels J. Hofmeyr wrote on Tue, 7 Oct 2008 at 06:04 +0200:
> I just added this Vim Tip for automatic subversion coding style in Vim. The
> advanced setup is found on the dev@ mailing list. The simpler setup isn't.
> Any additions/improvements welcome.
> 

This thread might be a good time to post the Subversion-related parts of 
my vimrc.  Attached.

Daniel

> http://vim.wikia.com/wiki/Subversion_developer_cindent_options