On Wed, Apr 19, 2006 at 09:31:51AM -0400, Cory Echols wrote:
> Assume I have the following line of code, and that my value for
> 'textwidth' is small enough to cause the line to be broken in insert
> mode:
> 
> public static void DoSomething(Type1 parameter1, Type2 parameter2)
> {
>    ...
> }
> 
> The default behavior for inserting the line breaks would cause the
> break to be inserted between "Type2" and "parameter2".  I think my
> code would be more readable if the line was broken between
> "parameter1," and "Type2".
> 
> I had *thought* that there was an option that would tell vim to favor
> breaking after a predefined character (such as a comma or colon) as
> opposed to simply breaking at the last whitespace just inside
> 'textwidth'.  However, I can no longer find it.  Is there a way to
> influence where line breaks are automatically inserted?

     Perhaps you are thinking of the 'breakat' option.  Unfortunately,
this works with 'wrap' and will not actually put line breaks into your
file.

     In vim 7.0 (nearing end of beta testing) there is a new option
'formatexpr' that you can use.  I have not experimented with this, and
it looks as though it might take some work, but I think it can do what
you want.

     Bram:  Can you add a link to 'formatexpr' from the docs for
'textwidth'?

HTH                                     --Benji Fisher

Reply via email to