Trouble with auto-format after upgrade to 6.4

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble with auto-format after upgrade to 6.4

Andrej Mikus
Team,

I am using vim for very extensively for e-mailing. With auto-format it
works well for me.

My admin upgraded recently to vim 6.4 and I noticed that I have problem
to manually force a line break, since now the word on new line gets
added to the previous one. This impacts my habits a lot.

I was able to locate information about Patch 6.2.327 that is most likely
responsible for the change I observe. Unfortunately, I am unable to find
any way to configure the operation I liked, other than to continue
using previous version of VIM.

There seems to be an option to indicate continuous paragraphs by adding
space to the previous line. This is something that would help me if the
operation could be reversed, e.g. to include space when I do *not* want
the next line to get joined during format.

Is there any advice available in the broad user community? If the change
is not possible via configuration, how could I request new options, like
auto-format running from current line only (this was the case in 6.2) or
manual line break inside of a paragraph?

I could perhaps change the source code to rollback the change made by
6.2.327 and recompile, but I do not consider it very scalable solution.
A configuration option for new VIM version could be perhaps more
preferred. How can I submit a change request? Do I need to provide a
patch with it?

Many thanks for any comments

Andrej Mikus
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with auto-format after upgrade to 6.4

Alan G Isaac
On Mon, 7 Nov 2005, Andrej Mikus apparently wrote:
> There seems to be an option to indicate continuous
> paragraphs by adding space to the previous line. This is
> something that would help me if the operation could be
> reversed, e.g. to include space when I do not want the
> next line to get joined during format.

I use this option a lot and like it.
It seems very natural to add a space to indicate that
reformatting is allowed, but to put a linebreak with no
space to indicate a required linebreak.  Why would you want
to reverse this?

Just curious,
Alan Isaac


Reply | Threaded
Open this post in threaded view
|

Re: Trouble with auto-format after upgrade to 6.4

Andrej Mikus
On Mon, 07.Nov.05 10:23:04 -0500, Alan G Isaac wrote:
> I use this option a lot and like it.
> It seems very natural to add a space to indicate that
> reformatting is allowed, but to put a linebreak with no
> space to indicate a required linebreak.  Why would you want
> to reverse this?

I do not like the additional space at the end of line, seems to me as a
waste of bandwidth. I know, not a big one, but still.

Basically I am looking for a way of entering manual line break into a
paragraph. Hitting space before CR could IMO solve the purpose, for the
price of one byte added in the file.

The previous operation of vim was very intuitive and I appreciated it.
All my linebreaks were entered by auto-format, and when I pressed
Return/Enter it terminated the line but not paragraph. Now my manual
linebreak is removed as soon as I start typing on next line.

The possibility of a formatoption with functionality opposite to 'w'
would also serve another good purpose, when editing a line like this,
the next line won't automatically join.

A configuration option to limit auto-format to the current line would
restore operation of 6.2 and in my case also save the blank character
at the preceding line.

Of course, both possibilities above require code change in vim, and
I have no visibility in how complex it would be. I wanted to check with
your community if someone could find a solution that could work with
just configuration change. Perhaps someone could suggest a set of
macros/scripts useful for typing email messages?

Thanks
Andrej
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with auto-format after upgrade to 6.4

Andrej Mikus
Keith,

Thanks for your comments. I understand that the current operation of
auto-format is as expected, and I also realize that I could benefit from
a side effect of a bug.

My application is as simple as typing e-mails. Most of the text is
paragraph oriented, so I am happy to use text-width to obtain linebreaks
automatically, and also auto-format to have the paragraphs reformatted
upon changes.

When it comes to signature (or other list-like data), my definition of
paragraph changes, and I prefer to have name, phone, address (and other
info) on different lines, but not in different paragraphs (separated by
blank line). Here was the bug in auto-format very handy.

I also benefit from the fact that command 'J' does not trigger
auto-format, and I am afraid now that this could get also classified as
a bug sooner or later :-(

In some instances I use :se paste to disable formatting. So far I did
not need it that much to start looking for some shortcut. Perhaps
someone could point me to a way how to toggle the option with one
keystroke and get an indication of the status. This is another
possibility to make me a happy vim user again.

I tried already to look in manuals for key mappings, but it seemed to me
very complex topic. Regarding the indication in status line, I do not
know whether it is at all possible.

Thanks
Andrej


On Mon, 07.Nov.05 15:34:05 -0800, Keith W. Roberts wrote:

> ----Original Message----
> From: Andrej Mikus [mailto:[hidden email]]
> Sent: Monday, November 07, 2005 3:01 PM
> To: Alan G Isaac
> Cc: [hidden email]
> Subject: Re: Trouble with auto-format after upgrade to 6.4
>
> > On Mon, 07.Nov.05 10:23:04 -0500, Alan G Isaac wrote:
> >> I use this option a lot and like it.
> >> It seems very natural to add a space to indicate that
> >> reformatting is allowed, but to put a linebreak with no
> >> space to indicate a required linebreak.  Why would you want
> >> to reverse this?
> >
> > I do not like the additional space at the end of line, seems
> > to me as a
> > waste of bandwidth. I know, not a big one, but still.
> >
> > Basically I am looking for a way of entering manual line break into a
> > paragraph. Hitting space before CR could IMO solve the
> > purpose, for the
> > price of one byte added in the file.
> >
> > The previous operation of vim was very intuitive and I appreciated it.
> > All my linebreaks were entered by auto-format, and when I pressed
> > Return/Enter it terminated the line but not paragraph. Now my manual
> > linebreak is removed as soon as I start typing on next line.
> >
> > The possibility of a formatoption with functionality opposite to 'w'
> > would also serve another good purpose, when editing a line like this,
> > the next line won't automatically join.
> >
> > A configuration option to limit auto-format to the current line would
> > restore operation of 6.2 and in my case also save the blank character
> > at the preceding line.
> >
> > Of course, both possibilities above require code change in vim, and
> > I have no visibility in how complex it would be. I wanted to
> > check with
> > your community if someone could find a solution that could work with
> > just configuration change. Perhaps someone could suggest a set of
> > macros/scripts useful for typing email messages?
> >
> > Thanks
> > Andrej
>
> First let me say that it's very possible that I don't know what I'm talking
> about, as I haven't followed your prior discussion(s) and don't know the
> application here. :)
>
> But ...
>
> Seems to me to be a non-issue, as paragraph boundaries are defined by empty
> lines, aren't they?  So a double <cr> creates a new paragraph, while a
> single <cr> doesn't.  Why make extra code to handle <space><cr> specially
> when <cr><cr> already does what you want?
>
> And a problem with whitespace at eol is that it's [normally] invisible, so
> anyone editing the file will consider adjacent sentences to be part of the
> same paragraph, anyway (unless wrap is set and \s& is hilighted specially,
> or something special is done to designate the paragraph boundary at bol for
> the *next* line).
>
> For whatever it's worth.
> -Keith
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with auto-format after upgrade to 6.4

Andrej Mikus
On Tue, 08.Nov.05 08:18:29 -0800, Keith W. Roberts wrote:
> >
> > Thanks for your comments. I understand that the current operation of
> > auto-format is as expected, and I also realize that I could
> > benefit from a side effect of a bug.
>
> First of all, please bottom-post; it makes reading/responding much easier,
> as well as being etiquette on this list. :)

Good hint, thanks.

>
> > My application is as simple as typing e-mails. Most of the text is
> > paragraph oriented, so I am happy to use text-width to obtain
> > linebreaks automatically, and also auto-format to have the paragraphs
> > reformatted upon changes.
> >
> > When it comes to signature (or other list-like data), my definition of
> > paragraph changes, and I prefer to have name, phone, address (and
> > other info) on different lines, but not in different paragraphs
> > (separated by blank line). Here was the bug in auto-format very handy.
>
> Ok, this makes sense.  Are you using someone's mail plugin, or your own
> settings/functions/etc.?  Most mail plugins (I think) use a special syntax
> file which defines the sig area differently, so that it can be treated
> differently.  Do you use the standard method of designating your sig (ie,
> '-- ' on its own line)?

I do not need to perform advanced tasks like reformat quotes or similar,
so I did not look for specific plugins or macros. I was happy with vi
for a long time. When I missed autowrap then I checked vim docs and
added this line to my .muttrc:
set editor='vim -c "set tw=72" -X -c "set nojs" -c "set fo=atcrq12" -c "syntax enable" +/Subj'

> > I also benefit from the fact that command 'J' does not trigger
> > auto-format, and I am afraid now that this could get also
> > classified as a bug sooner or later :-(
>
> Probably. :)
>
> > In some instances I use :se paste to disable formatting. So far I did
> > not need it that much to start looking for some shortcut.
>
> I hate 'paste' and *never* use it.  Too many side-effects to just toggle it.

I used it also to disable tw and to type longer lines. Not often enough
to think if there would be a better way. Now I see it disables also the
key mappings so I will have to change the formatting options instead.

> > Perhaps someone could point me to a way how to toggle the option
> > with one keystroke and get an indication of the status. This is
> > another possibility to make me a happy vim user again.
>
> If you're talking about toggling auto-format, that's as simple as
> adding/removing the 'a' from 'formatoptions', as (untested):
>
> inoremap ++a <c-o>:set fo-=a<cr><c-o>:set fo+=a<cr>
> inoremap --a <c-o>:set fo-=a<cr>

This works great. The change is made with 3 keystrokes, but now you
teached me how to create key mapping so I will be able to figure out
something that will work for me. When it comes to creation of mutt
specific .vimrc file, I can also make the editor line shorter.

Currently I changed the config from system-wide default to use version
6.2, so I have time until this version gets removed from our systems.

> First of all, I dislike toggles, since it's difficult to know the current
> state sometimes, so I tend to explicitly set/unset instead.

Understood, point taken. Different keys to set/unset also remove the
need for indication, discussed below.

> Secondly toggling an option from inside Insert mode and seeing the
> result can be problematic. I think I've done it by:
>
> a) calling a function which uses a b:var to keep the current setting, flips
> the value and stores the new setting, then uses redraw! to force the
> statusline to be changed, and
> b) adding a function to the statusline which returns the current b:var
> setting
>
> Thirdly, you'll notice that ++a unsets the option before setting it.  That's
> to avoid piling up a's in &fo by using ++a when it's already set.

Nice trick. Will have to remember.

> If you are already using a filetype for these buffers, then I'd do (b) above
> no matter what else you do, just so you can see the setting when you enter
> the buffer.  If you need help with the functions, let me know.

Thanks for the offer. I will certainly contact this list in case of
further troubles with VIM.

Andrej