vile
[Top][All Lists]
Advanced

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

Re: [vile] comment leaders and reformatting


From: Thomas Dickey
Subject: Re: [vile] comment leaders and reformatting
Date: Sat, 5 Jun 2010 18:54:04 -0400 (EDT)

On Sat, 5 Jun 2010, address@hidden wrote:

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?

yes (sorry about that).  The name=value stuff is parsed the same, but
there's no "set" keyword there.


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?

I usually refer to the "Regular Expressions" section in the help-file (vile.hlp). Also, for debugging long patterns, I find it useful to turn visual-matches to reverse, and just try searching with a given pattern:

set visual-matches=reverse
set nooverlap-matches



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'.

no - the keystrokes get complicated. I generally mark a line and format from the :-line (or if I'm doing something repetitive, I bind 'K' to whatever's useful at the moment). The other people using vile tend to use the fancier key-bindings...

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

_______________________________________________
vile mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/vile


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net



reply via email to

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