You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kevin Pilch-Bisson <ke...@pilch-bisson.net> on 2001/09/06 17:37:01 UTC

Adding vim comment string to files

Hi everyone,

Anyone object if I change all the subversion .c and .h files which currently
include the emacs load file block to also include the following lines in the
block which will set vim options to the subversion coding style.

The only drawback to this is that if they change, it needs to be changed in
every file instead of just one. (Although I already have a script which 
inserted the lines, which could be tweaked to change them instead).
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: Adding vim comment string to files

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
 
> Unfortunately, it isn't possible to have it load an external file.  From the
> VIM documentation (section Automatically setting options)
> 
> 'No other commands than "set" are supported, for security reasons (somebody
> might create a Trojan Horse text file with modelines).'

i guess that makes sense...

how about providing a svn.vim file that people can source from their
vimrv and just set a variable to turn on all that stuff in the actual
files.  it just seems like a whole lot of crud to have in every file.
there's gotta be a better way to do this.

> The lines to be added are:
> 
>  * vim:ts=4:sw=4:expandtab:tw=80:fo=tcroq
>  * vim:isk=a-z,A-Z,48-57,_,.,-,>
>  * vim:cino=>1s,e0,n0,f0,{.5s,}0,^-.5s,=.5s,t0,+1s,c3,(0,u0,\:0
> 
> Which are fairly uniqe and easy to sed, if there is a need to change them.
> 
> What I would like is for someone else who uses VIM to look at them, and see if
> they match Subversion coding style.  (I think they do, based on my tests, but
> thought I would check with someone else).

it looks about right, but i'm at work right now so i can't really give
it the attention it deserves...

-- 
garrett rooney                     Unix was not designed to stop you from 
rooneg@electricjellyfish.net       doing stupid things, because that would  
http://electricjellyfish.net/      stop you from doing clever things.

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

Re: Adding vim comment string to files

Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Thu, Sep 06, 2001 at 01:47:05PM -0400, Kevin Pilch-Bisson wrote:
> On Thu, Sep 06, 2001 at 01:50:56PM -0400, Garrett Rooney wrote:
> > 
> > i'm sure the vim users among us (myself included) would love to attain
> > equal status to the emacs people, but rather than having the comments
> > in each file couldn't we have a single comment that has vim source one
> > file with all the settings?  i think .vim files have the ability to
> > source other files, so i imagine it might be possible to do such a
> > thing from a vim comment.
> 
> I'm still investigating.  How's this, if I can find such a way I'll check it in,
> otherwise I'll leave it.

Unfortunately, it isn't possible to have it load an external file.  From the
VIM documentation (section Automatically setting options)

'No other commands than "set" are supported, for security reasons (somebody
might create a Trojan Horse text file with modelines).'

The lines to be added are:

 * vim:ts=4:sw=4:expandtab:tw=80:fo=tcroq
 * vim:isk=a-z,A-Z,48-57,_,.,-,>
 * vim:cino=>1s,e0,n0,f0,{.5s,}0,^-.5s,=.5s,t0,+1s,c3,(0,u0,\:0

Which are fairly uniqe and easy to sed, if there is a need to change them.

What I would like is for someone else who uses VIM to look at them, and see if
they match Subversion coding style.  (I think they do, based on my tests, but
thought I would check with someone else).
> 
> -- 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Kevin Pilch-Bisson                    http://www.pilch-bisson.net
>      "Historically speaking, the presences of wheels in Unix
>      has never precluded their reinvention." - Larry Wall
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: Adding vim comment string to files

Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Thu, Sep 06, 2001 at 01:50:56PM -0400, Garrett Rooney wrote:
> On Thu, Sep 06, 2001 at 01:37:01PM -0400, Kevin Pilch-Bisson wrote:
> > Hi everyone,
> > 
> > Anyone object if I change all the subversion .c and .h files which currently
> > include the emacs load file block to also include the following lines in the
> > block which will set vim options to the subversion coding style.
> > 
> > The only drawback to this is that if they change, it needs to be changed in
> > every file instead of just one. (Although I already have a script which 
> > inserted the lines, which could be tweaked to change them instead).
> 
> i'm sure the vim users among us (myself included) would love to attain
> equal status to the emacs people, but rather than having the comments
> in each file couldn't we have a single comment that has vim source one
> file with all the settings?  i think .vim files have the ability to
> source other files, so i imagine it might be possible to do such a
> thing from a vim comment.

I'm still investigating.  How's this, if I can find such a way I'll check it in,
otherwise I'll leave it.

> 
> -- 
> garrett rooney                     Unix was not designed to stop you from 
> rooneg@electricjellyfish.net       doing stupid things, because that would  
> http://electricjellyfish.net/      stop you from doing clever things.
> 

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: Adding vim comment string to files

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Thu, Sep 06, 2001 at 01:37:01PM -0400, Kevin Pilch-Bisson wrote:
> Hi everyone,
> 
> Anyone object if I change all the subversion .c and .h files which currently
> include the emacs load file block to also include the following lines in the
> block which will set vim options to the subversion coding style.
> 
> The only drawback to this is that if they change, it needs to be changed in
> every file instead of just one. (Although I already have a script which 
> inserted the lines, which could be tweaked to change them instead).

i'm sure the vim users among us (myself included) would love to attain
equal status to the emacs people, but rather than having the comments
in each file couldn't we have a single comment that has vim source one
file with all the settings?  i think .vim files have the ability to
source other files, so i imagine it might be possible to do such a
thing from a vim comment.

-- 
garrett rooney                     Unix was not designed to stop you from 
rooneg@electricjellyfish.net       doing stupid things, because that would  
http://electricjellyfish.net/      stop you from doing clever things.

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