Re: vim and mutt question

2001-03-27 Thread Peter Poeml

On Sat, Mar 24, 2001 at 01:47:25PM +0200, Peter Pentchev wrote:
> On Sat, Mar 24, 2001 at 01:06:22AM -0800, Jason Helfman wrote:
> 
> According to the note, it would be OK to do something like:
> 
>   set editor="vim -c 'set tw=72 et' -c ':0;/^$'
> 

You can also put things like 

  autocmd BufRead mutt*   set textwidth=72 et syntax=mail nobk 

into your .vimrc.


Gruesse, 
Peter
-- 
+49-911-74053-340
--
When in danger, or in doubt, run in circles, scream and shout.
   -- Robert A. Heinlein



Re: vim and mutt question

2001-03-26 Thread Horace G. Friend III

On Mon, Mar 26, 2001 at 04:40:20PM +0200, [EMAIL PROTECTED] wrote:
> 
> "Horace G. Friend III" <[EMAIL PROTECTED]> wrote:
> 
> 
> > I would like to ask a question since the search command has a
> > side-effect in the editor. Since the "-c ':$;?^$'" is a search command
> > for a blank line, it leaves blank lines highlighted as a result of the
> > search. How can I make this disappear automatically?
> 
> Try vim -c ":$;?^$" -c ":nohls".
> 
> This will switch off highlighting the most recent search pattern,
> but keeps hlsearch option set, i.e. the next search pattern will
> be highlighted again. This is most probably what you want.
> 
> Best regards - Juergen.
> 
> -- 
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net

Exactly what I was looking for. Thanks very much. 
-- 
Horace G. Friend III
[EMAIL PROTECTED]
GnuPG DSA/ElGamal Key Fingerprint
9295 80C4 C723 621B 9C2D  B53E D432 7936 4CA9 8AD6



Re: vim and mutt question

2001-03-26 Thread juergen . salk

X-Priority: 3 (Normal)
X-Authenticated-Sender: #[EMAIL PROTECTED]
X-Authenticated-IP: [134.60.50.4]
Message-ID: <[EMAIL PROTECTED]>
X-Mailer: WWW-Mail 1.5 (Global Message Exchange)
X-Flags: 0001
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

"Horace G. Friend III" <[EMAIL PROTECTED]> wrote:


> I would like to ask a question since the search command has a
> side-effect in the editor. Since the "-c ':$;?^$'" is a search command
> for a blank line, it leaves blank lines highlighted as a result of the
> search. How can I make this disappear automatically?

Try vim -c ":$;?^$" -c ":nohls".

This will switch off highlighting the most recent search pattern,
but keeps hlsearch option set, i.e. the next search pattern will
be highlighted again. This is most probably what you want.

Best regards - Juergen.

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net




Re: vim and mutt question

2001-03-26 Thread Horace G. Friend III

On Sun, Mar 25, 2001 at 12:35:42PM -0500, Wade A. Mosely wrote:
> Timothy Legant wrote:
> > You might not always want to move down 6 lines. Perhaps in the future
> > you will add a new header (using my_hdr) to certain messages. You might
> > want to consider the following instead:
> > 
> > set editor="vim -c ':0;/^$'"
> > 
> > which will search for and move to the first blank line. In an email
> > message that should be the first line after all the headers, no matter
> > how many header lines there are.
> 
> That's great, Tim!  It sure beats what I had been using
> before.  However, I like to edit my replies after quoted
> messages, so I think '-c ":$;?^$"' is a better command line
> argument for me, since it places the cursor on the last blank
> line, i.e. after any quoted text but before my signature.
> 
> -- Mr. Wade
> 
> -- 
> Linux: The Choice of the GNU Generation

This thread has been very interesting and helpful as I am also
configuring/improving Mutt.

I would like to ask a question since the search command has a
side-effect in the editor. Since the "-c ':$;?^$'" is a search command
for a blank line, it leaves blank lines highlighted as a result of the
search. How can I make this disappear automatically?

Thanks.
-- 
Horace G. Friend III
[EMAIL PROTECTED]
GnuPG DSA/ElGamal Key Fingerprint
9295 80C4 C723 621B 9C2D  B53E D432 7936 4CA9 8AD6



Re: vim and mutt question

2001-03-25 Thread Wade A. Mosely

Timothy Legant wrote:
> You might not always want to move down 6 lines. Perhaps in the future
> you will add a new header (using my_hdr) to certain messages. You might
> want to consider the following instead:
> 
> set editor="vim -c ':0;/^$'"
> 
> which will search for and move to the first blank line. In an email
> message that should be the first line after all the headers, no matter
> how many header lines there are.

That's great, Tim!  It sure beats what I had been using
before.  However, I like to edit my replies after quoted
messages, so I think '-c ":$;?^$"' is a better command line
argument for me, since it places the cursor on the last blank
line, i.e. after any quoted text but before my signature.

-- Mr. Wade

-- 
Linux: The Choice of the GNU Generation




Re: vim and mutt question

2001-03-24 Thread David Champion

On 2001.03.24, in <[EMAIL PROTECTED]>,
"Timothy Legant" <[EMAIL PROTECTED]> wrote:
>
> You might not always want to move down 6 lines. Perhaps in the future
> you will add a new header (using my_hdr) to certain messages. You might
> want to consider the following instead:
> 
> set editor="vim -c ':0;/^$'"

I use
set editor="vi +'/: *$'"

to that I begin editing on the first empty header.  Generally, this is
To:, since I don't prompt for addresses before opening the editor.

If you wish to try that, it shouldn't matter that I use vi and you use
something that thinks it's vi. :)  The same argument string should work
fine in either, in this case.


On 2001.03.24, in <[EMAIL PROTECTED]>,
"Jason Helfman" <[EMAIL PROTECTED]> wrote:
> I'd like to use this setting, too, but right now I have:
> 
> set editor="vim -c 'set tw=72 et'"
> 
> Can I incorporate this into it??
> 
> set editor="vim -c ':0;/^$'"

Can you just put
set tw=72 et

in your .exrc or .vimrc?  That seems more probably appropriate to me,
though it might not be, depending on your reasons.

-- 
 -D.[EMAIL PROTECTED]NSITUniversity of Chicago



Re: vim and mutt question

2001-03-24 Thread John P. Verel

> You might not always want to move down 6 lines. Perhaps in the future
> you will add a new header (using my_hdr) to certain messages. You might
> want to consider the following instead:
> 
> set editor="vim -c ':0;/^$'"
> 
> which will search for and move to the first blank line. In an email
> message that should be the first line after all the headers, no matter
> how many header lines there are.
Hey Tim!  A great one.  Thanks!  I'd just been doing vim + on my editor
line, taking to the bottom of a new mail.  This is much better.  Thanks!
John
-- 
John P. Verel
Norwalk, CT



Re: vim and mutt question

2001-03-24 Thread Peter Pentchev

And btw, mail to the [EMAIL PROTECTED] address bounces.

G'luck,
Peter

-- 
I am the thought you are now thinking.

On Sat, Mar 24, 2001 at 01:47:25PM +0200, Peter Pentchev wrote:
> On Sat, Mar 24, 2001 at 01:06:22AM -0800, Jason Helfman wrote:
> > I'd like to use this setting, too, but right now I have:
> > 
> > set editor="vim -c 'set tw=72 et'"
> > 
> > Can I incorporate this into it??
> > 
> > set editor="vim -c ':0;/^$'"
> 
> From the vim manpage:
> 
>-c {command}
>{command} will be  executed  after  the  first
>file  has been read.  {command} is interpreted
>as an Ex command.  If the  {command}  contains
>spaces  it  must  be enclosed in double quotes
>(this depends on  the  shell  that  is  used).
>Example: Vim "+set si" main.c
>Note:  You  can  use up to 10 "+" or "-c" com-
>mands.
> 
> According to the note, it would be OK to do something like:
> 
>   set editor="vim -c 'set tw=72 et' -c ':0;/^$'
> 
> G'luck,
> Peter
> 
> -- 
> I had to translate this sentence into English because I could not read the original 
>Sanskrit.
> 
> > On Sat, Mar 24, 2001 at 02:31:29AM -0600, Timothy Legant muttered:
> > | On Sat, Mar 24, 2001 at 09:59:45AM +0200, Peter Pentchev wrote:
> > | > On Sat, Mar 24, 2001 at 07:35:12AM +, Viktor Lakics wrote:
> > | > > Hi All,
> > | > > 
> > | > > I have an autocommand for temporary mutt files. I want to move the
> > | > > cursor down 6 positions automatically when I start a new mail (this
> > | > > would move the cursor right under the headers (i use edit headers).  > But i 
>can't seem to figure out how to do this from a vimrc file...
> > | > 
> > | > You could try setting the mutt 'editor' variable to something like
> > | > 
> > | > /usr/local/bin/vim +6j
> > | > 
> > | > This shall affect editing old messages, too, but it will probably
> > | > do what you want.
> > | 
> > | You might not always want to move down 6 lines. Perhaps in the future
> > | you will add a new header (using my_hdr) to certain messages. You might
> > | want to consider the following instead:
> > | 
> > | set editor="vim -c ':0;/^$'"
> > | 
> > | which will search for and move to the first blank line. In an email
> > | message that should be the first line after all the headers, no matter
> > | how many header lines there are.
> 



Re: vim and mutt question

2001-03-24 Thread Peter Pentchev

On Sat, Mar 24, 2001 at 01:06:22AM -0800, Jason Helfman wrote:
> I'd like to use this setting, too, but right now I have:
> 
> set editor="vim -c 'set tw=72 et'"
> 
> Can I incorporate this into it??
> 
> set editor="vim -c ':0;/^$'"

>From the vim manpage:

   -c {command}
   {command} will be  executed  after  the  first
   file  has been read.  {command} is interpreted
   as an Ex command.  If the  {command}  contains
   spaces  it  must  be enclosed in double quotes
   (this depends on  the  shell  that  is  used).
   Example: Vim "+set si" main.c
   Note:  You  can  use up to 10 "+" or "-c" com-
   mands.

According to the note, it would be OK to do something like:

set editor="vim -c 'set tw=72 et' -c ':0;/^$'

G'luck,
Peter

-- 
I had to translate this sentence into English because I could not read the original 
Sanskrit.

> On Sat, Mar 24, 2001 at 02:31:29AM -0600, Timothy Legant muttered:
> | On Sat, Mar 24, 2001 at 09:59:45AM +0200, Peter Pentchev wrote:
> | > On Sat, Mar 24, 2001 at 07:35:12AM +, Viktor Lakics wrote:
> | > > Hi All,
> | > > 
> | > > I have an autocommand for temporary mutt files. I want to move the
> | > > cursor down 6 positions automatically when I start a new mail (this
> | > > would move the cursor right under the headers (i use edit headers).  > But i 
>can't seem to figure out how to do this from a vimrc file...
> | > 
> | > You could try setting the mutt 'editor' variable to something like
> | > 
> | >   /usr/local/bin/vim +6j
> | > 
> | > This shall affect editing old messages, too, but it will probably
> | > do what you want.
> | 
> | You might not always want to move down 6 lines. Perhaps in the future
> | you will add a new header (using my_hdr) to certain messages. You might
> | want to consider the following instead:
> | 
> | set editor="vim -c ':0;/^$'"
> | 
> | which will search for and move to the first blank line. In an email
> | message that should be the first line after all the headers, no matter
> | how many header lines there are.



Re: vim and mutt question

2001-03-24 Thread Jason Helfman

I'd like to use this setting, too, but right now I have:

set editor="vim -c 'set tw=72 et'"

Can I incorporate this into it??

set editor="vim -c ':0;/^$'"

On Sat, Mar 24, 2001 at 02:31:29AM -0600, Timothy Legant muttered:
| On Sat, Mar 24, 2001 at 09:59:45AM +0200, Peter Pentchev wrote:
| > On Sat, Mar 24, 2001 at 07:35:12AM +, Viktor Lakics wrote:
| > > Hi All,
| > > 
| > > I have an autocommand for temporary mutt files. I want to move the
| > > cursor down 6 positions automatically when I start a new mail (this
| > > would move the cursor right under the headers (i use edit headers).  > But i 
|can't seem to figure out how to do this from a vimrc file...
| > 
| > You could try setting the mutt 'editor' variable to something like
| > 
| > /usr/local/bin/vim +6j
| > 
| > This shall affect editing old messages, too, but it will probably
| > do what you want.
| 
| You might not always want to move down 6 lines. Perhaps in the future
| you will add a new header (using my_hdr) to certain messages. You might
| want to consider the following instead:
| 
| set editor="vim -c ':0;/^$'"
| 
| which will search for and move to the first blank line. In an email
| message that should be the first line after all the headers, no matter
| how many header lines there are.
| 
| Tim

-- 
/Jason G Helfman

"At any given moment, you may find the ticket to the circus that has always
been in your possession."

Fingerprint: 6A32 3774 E390 33B5 8C96  2AA1 2BF4 BD71 35A1 C149
GnuPG http://www.gnupg.org  Get Private!  1024D/35A1C149



Re: vim and mutt question

2001-03-24 Thread Gary Johnson

On Sat, Mar 24, 2001 at 07:35:12AM +, Viktor Lakics wrote:

> I have an autocommand for temporary mutt files. I want to move the
> cursor down 6 positions automatically when I start a new mail (this
> would move the cursor right under the headers (i use edit headers).
> But i can't seem to figure out how to do this from a vimrc file...
> 
> Any help?

Something like this should work:

au BufRead  /tmp/mutt-* normal 6j

but I would suggest something more like this:

au BufRead  /tmp/mutt-* normal }

so that you cursor is always under the headers even if the number of
header lines changes.

Gary

-- 
Gary Johnson   | Agilent Technologies
[EMAIL PROTECTED]   | RF Communications PGU
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA



Re: vim and mutt question

2001-03-24 Thread Peter Pentchev

On Sat, Mar 24, 2001 at 02:31:29AM -0600, Timothy Legant wrote:
> On Sat, Mar 24, 2001 at 09:59:45AM +0200, Peter Pentchev wrote:
> > On Sat, Mar 24, 2001 at 07:35:12AM +, Viktor Lakics wrote:
> > > Hi All,
> > > 
> > > I have an autocommand for temporary mutt files. I want to move the
> > > cursor down 6 positions automatically when I start a new mail (this
> > > would move the cursor right under the headers (i use edit headers).  > But i 
>can't seem to figure out how to do this from a vimrc file...
> > 
> > You could try setting the mutt 'editor' variable to something like
> > 
> > /usr/local/bin/vim +6j
> > 
> > This shall affect editing old messages, too, but it will probably
> > do what you want.
> 
> You might not always want to move down 6 lines. Perhaps in the future
> you will add a new header (using my_hdr) to certain messages. You might
> want to consider the following instead:
> 
> set editor="vim -c ':0;/^$'"
> 
> which will search for and move to the first blank line. In an email
> message that should be the first line after all the headers, no matter
> how many header lines there are.

Yeah, that would work better :)

G'luck,
Peter

-- 
No language can express every thought unambiguously, least of all this one.



Re: vim and mutt question

2001-03-24 Thread Timothy Legant

On Sat, Mar 24, 2001 at 09:59:45AM +0200, Peter Pentchev wrote:
> On Sat, Mar 24, 2001 at 07:35:12AM +, Viktor Lakics wrote:
> > Hi All,
> > 
> > I have an autocommand for temporary mutt files. I want to move the
> > cursor down 6 positions automatically when I start a new mail (this
> > would move the cursor right under the headers (i use edit headers).  > But i can't 
>seem to figure out how to do this from a vimrc file...
> 
> You could try setting the mutt 'editor' variable to something like
> 
>   /usr/local/bin/vim +6j
> 
> This shall affect editing old messages, too, but it will probably
> do what you want.

You might not always want to move down 6 lines. Perhaps in the future
you will add a new header (using my_hdr) to certain messages. You might
want to consider the following instead:

set editor="vim -c ':0;/^$'"

which will search for and move to the first blank line. In an email
message that should be the first line after all the headers, no matter
how many header lines there are.

Tim



Re: vim and mutt question

2001-03-23 Thread Peter Pentchev

On Sat, Mar 24, 2001 at 07:35:12AM +, Viktor Lakics wrote:
> Hi All,
> 
> I have an autocommand for temporary mutt files. I want to move the
> cursor down 6 positions automatically when I start a new mail (this
> would move the cursor right under the headers (i use edit headers).  > But i can't 
>seem to figure out how to do this from a vimrc file...

You could try setting the mutt 'editor' variable to something like

/usr/local/bin/vim +6j

This shall affect editing old messages, too, but it will probably
do what you want.

G'luck,
Peter

-- 
Do you think anybody has ever had *precisely this thought* before?