LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Mutt mysteriously changes/breaks vim settings (https://www.linuxquestions.org/questions/linux-desktop-74/mutt-mysteriously-changes-breaks-vim-settings-511709/)

HypoCee 12-18-2006 04:04 PM

Mutt mysteriously changes/breaks vim settings
 
I'm new to mutt, seminew to vi[m]. Mutt is version 1.5.12 and vim is version 7, patches 1-118 according to their version statements. Both are running on an Arch Linux system which was installed fresh and fully updated (pacman -Syu) a month ago. A month in I'm liking mutt so far, but like everyone I've got my own opinion on what I want it to do.

The particular thing I'm trying to accomplish is because I'm in a predominantly Microsoft environment. When mutt/vim autowraps my lines it may be the UNIX Way but my emails are awkward to read and Outlook tears them to shreds in replies and forwards. I also tend to do some editing after initially writing a body, so I wind up with insane linebreaks which I haven't hacked vim enough to fix conveniently. I know there's some super paragraph macro {ql:?#boogabooga} or whatever, but long story short I'm not mailing to terminals and I've got this big button on the keyboard for putting in my own linebreaks, thanks very much.

I've made minimal changes to my .vimrc - first I tried
Code:

set textwidth=0
and then switched to
Code:

set fo=q
during troubleshooting. Both appear to have the same effect for my purposes. This command is the only thing in my ~/.vimrc . When run from the command line, it works the way I want. Lines fill the window and only appear to wrap, and arrow keys and delete work.

Unfortunately, mutt appears to ignore or break this in some way. Here's where it gets somewhat weird.

If I change the editor variable in my ~/.muttrc to just "vi" or "vim", then when sending email A) the launched vim autowraps my lines at 80 columns and B) arrows and delete work OK. If I use the "vim -u ~/.vimrc" option, A) the launched vim properly lets my lines run but B) arrows produce capital A, B, C, D (probably with Ctrl bits which I can't see) and delete in insert mode does its "screw up your case" operation for the first keystroke, then deletes characters properly on all subsequent ones until the next switch to insert mode.

My ~/.muttrc follows.
Code:

set folder="~/Mail"
set sendmail="/usr/bin/msmtp"
set use_from=yes
set realname="xxxxxxx"
set from=xxxxx@xxxx.xxx
set envelope_from=yes
set move=no
set editor="vim -u ~/.vimrc"
set fast_reply=yes
set sort=threads

fcc-hook .* ~/Mail/SENT
macro index  G "!getmail -v\n" "Invoke getmail"

The final thing I've checked is that I have no ~/.mutt/ to screw things up. Most of the stuff I've found manning and Googling this has to do with people wanting vim to use different settings when called from mutt. I just want it to use the same settings; I can break it myself later, when I've learned more. Any elders' ideas are respectfully solicited.

HypoCee 12-19-2006 09:21 AM

This thread deals with the same problem, but uses the inelegant method of passing all vim settings explicitly from /muttrc.


All times are GMT -5. The time now is 10:45 PM.