Thomas Adam wrote:

  | Hello All,
  |
  | (Tim -- apologise for the broadcast announcement, but you were
  | the original person who gave me this solution).
  |
  | Some time ago, I asked a question on this list about
  | reformatting lines of text (lines in an email reply). Tim Chase
  | was kind enough to give me a rather thorough break-down which I
  | published in the Linux Gazette
  | (http://linuxgazette.net/108/tag/1.html). The idea behind it was
  | to reformat all lines that started with ">" to a width of 72
  | characters, and for any split lines that occured once that had
  | been done, to add a ">" at the start of the line. Indeed, from
  | that I came up with this:
  |
  | :g/^>/+,/^>[EMAIL PROTECTED]/-1! par 72q
  |
  | Which works fine -- almost. The one niggle I have with it is
  | that if an email I am replying to has a shell-script snippet
  | (example as it appears in an email I am replying to):
  |
  | > ``
  | > #!/bin/sh
  | > some_command &
  | > other_command &
  | > ''
  |  
  | What happens in the email after formatting is I see this:
  | 
  | > ``#!/bin/sh some_command & other_command &''
  | 
  | I don't want this, since I have to then go through the block by
  | hand and undo it -- it's especially annoying since the
  | formatting of things like code-snippets when you need to
  | critique them is important.
  |
  | Of course, I assume this to be the correct behaviour for the
  | command that's formatting this -- and it _is_ doing what it has
  | been asked. But I don't understand why it happens for the
  | example above (and other examples). I'd have expected it to
  | happen for ALL lines in an email, i.e.:
  |
  | > some text > other text > more text
  | 
  | But that's not the case (luckily).
  |  
  | So my question is, what is it about the command:
  | 
  | :g/^>/+,/^>[EMAIL PROTECTED]/-1! par 72q
  | 
  | Which causes this to happen?  I've tried changing it but the
  | result is always the same.
  | 
  | Many thanks in advance for any hints you might be able to
  | provide.
   
  It's being done by Vim treating > as a comment indicator -- see
  help on 'comments' and format-comments

  --Suresh

Reply via email to