vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vile] comment leaders and reformatting


From: lists-vile
Subject: Re: [vile] comment leaders and reformatting
Date: Sat, 5 Jun 2010 18:18:08 -0400
User-agent: Mutt/1.4.2.3i

Thomas, 

Excellent, thank you for the reply.

I'm not always diligent about ';#', some of my comments begin with just '#' so
I ended up with this:

comment-prefix='^\s*;\?# '

Also note I was unable to use the 'set' command as you've specified below, it
did work without the 'set' command however.  I assume when defining options
for submodes the 'set' command is unnecessary?

I tend to struggle with what requires escaping in vi-style regular expressions. 
At first I tried this '^\s*;?#'.  Is there a definitive list or a set of rules
that govern what should and should not be escaped?

Ahhh yes, I use screen all the time as well. Have you found a convenient
replacement for ^a?  Right now I'm being lazy and using '^a a'.

Thanks for the assistance and for maintaining the vile editor.

Wayne

On Sat, Jun 05, 2010 at 05:25:01PM -0400, Thomas Dickey wrote:
> On Sat, 5 Jun 2010, address@hidden wrote:
> 
> >
> >Hello all,
> >
> >I'm a recent vim convert and I have few lingering issues before I'm a full
> >convert.  When working with TCL files I prefer my comment lines to look 
> >like
> >this.
> >
> >     ;# comment line 1
> >     ;# comment line 2
> >     ;# comment line 3
> >     ;# comment line 4
> >
> >In vim if I were to edit one of the comment lines and make it a very long 
> >line
> >I could use the gq} command to reformat my comments.  This in combination 
> >with
> >the 'comments' setting will reformant the block of comments inserting the 
> >';#'
> >sequence at the beginning of each line.
> 
> Two parts -
> 
> a) settings
> 
> vile uses the comment-prefix pattern, which for this case would be set
> something like (in your .vilerc file):
> 
> ~with define-submode tcl
> set comment-prefix='^\s*;# '
> ~endwith
> 
> That's the same as
> 
> define-submode tbl set comment-prefix='^\s*;# '
> 
> b) reformatting
> 
> That gq} looks like vile's
> 
>       format-til next-paragraph
> 
> "format-til" is normally bound to ^A-f (control/A, f) and ^A-j.
> With those bindings, you could do the analogous ^A, f, }.
> 
> Something like that (I'm usually using screen, which owns ^A...)
> 
> -- 
> Thomas E. Dickey
> http://invisible-island.net
> ftp://invisible-island.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]