[lug] Mutt 1.4.2.2i and Vim 7.0 Not Getting Along

Bill Thoen bthoen at gisnet.com
Mon Jan 1 13:10:27 MST 2007


Sean, 

It will probably take you a lot less time to find what doesn't work
right in the attached vimrc file than I, so if you or anyone else wants 
to poke at it to find what causes this problem, have at it. I picked this 
up a few years ago and used it for editing my mutt mail because it had a 
routine in it somewhere that allowed mme to easily reformat a paragraph. 
It has worked fine with FC5, but there's something in it that now messes 
up color escape code on an xterm terminal.

At any rate, my default .vimrc works fine (although reformatting
paragraphs is a pain again), but this one doesn't handle syntax
highlighting well at all.

- Bill Thoen


On Mon, Jan 01, 2007 at 12:47:10PM -0700, Sean Reifschneider wrote:
> On Mon, Jan 01, 2007 at 08:21:38AM -0700, Bill Thoen wrote:
> >I've been using mutt with vim as the editor but after upgrading my Fedora
> >Core system from version 5 to 6 I've been having a problem with weird
> 
> Kevin didn't have a problem with this on his boxes, where he did a update
> from 5 to 6.  I had exactly the same problem you did.  I had a version of
> vim7 that I built under FC5, and when I retrograded the vim packages to
> that version, everything worked fine.  So, I'm assuming it must be a
> problem with the vim package in FC6, but haven't done any extensive
> work to track down exactly what it is.  I did some poking, but didn't find
> anything.
> 
> Sean
-------------- next part --------------
version 6.3

set background=dark
set noautoindent
set ic
set bf
set textwidth=75
set tabstop=8
set showmatch
set sh=/bin/bash
nmap <C-J> vipgq
nmap <C-J> gq

set autowrite
set nobackup
set backspace=2
set nocompatible
set comments=b:#,:%,fb:-,n:>,n:)
set dictionary=/usr/dict/words,/usr/local/ispell/words 
set digraph
set noerrorbells
set esckeys
set noexpandtab
set helpheight=0
set hidden
set highlight=8r,db,es,hs,mb,Mr,nu,rs,sr,tb,vr,ws
set nohlsearch
set noicon
set ignorecase
set noinsertmode
"       iskeyword:
"       iskeyword=@,48-57,_,192-255   (default)
" Add the dash ('-'), the dot ('.'), and the '@' as "letters" to "words".
" This makes it possible to expand email addresses, eg
" guckes-www at vim.org
set iskeyword=@,48-57,_,192-255,-,., at -@
set joinspaces
set   laststatus=2
set   lazyredraw
set   magic
"       modeline:    ...
"       Allow the last line to be a modeline - useful when
"       the last line in sig gives the preferred textwidth for replies.
"  set   modeline
"  set   modelines=1
"
set nonumber
set path=.,,/usr/share/vim/vim63/syntax/
set pastetoggle=<f11>
set report=0
set ruler
set shiftwidth=8
set shortmess=at
set showcmd
set showmatch
set showmode
set nostartofline
set splitbelow
set   tabstop=8

" Set the colors for vim on "xterm"
  if &term=="xterm"
  set t_Co=8
  set t_AB=[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm
  set t_AF=[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm
  endif

set notextmode
set notitle
set nottyfast
set nottybuiltin
set ttyscroll=0
set visualbell
set t_vb=
set whichwrap=<,>,h,l
set   wildchar=<TAB>
set   wrapmargin=1


" Abbreviations for some important numbers:
  iab Npi 3.1415926535897932384626433832795028841972
  iab Ne  2.7182818284590452353602874713526624977573
  iab Yalpha abcdefghijklmnopqrstuvwxyz
  iab YALPHA ABCDEFGHIJKLMNOPQRSTUVWXYZ
  iab Ydigit 1234567890
  iab Yruler 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
  iab Ysuper supercalifragilisticexpialidocious
  iab Yanti antidisestablishmentarianism
  iab Ypass "You are in a maze of twisty little passages, all alike."
  iab Yicty  I could tell you - but then I'd have to kill you.
  iab Ybtdt  Been there, done that, got the tshirt.
"     Ysesqui : "Sesquipedalophobia" means "fear of big words."  ;-)
  iab Ysesqui    sesquipedalophobia
  iab Yi18n  internationalization
  iab alos      also
  iab aslo      also
  iab bianry    binary
  iab bianries  binaries
  iab charcter  character
  iab charcters characters
  iab exmaple   example
  iab exmaples  examples
  iab shoudl    should
  iab seperate  separate
  iab teh       the
  iab tpyo      typo
  iab Ydate <C-R>=strftime("%y%m%d")<CR>
  iab Ytime <C-R>=strftime("%H:%M")<CR>
  iab YDT   <C-R>=strftime("%y%m%d %T")<CR>
  iab YDATE <C-R>=strftime("%a %b %d %T %Z %Y")<CR>

" Many shells allow editing in "Emacs Style".
" Although I love Vi, I am quite used to this kind of editing now.
" So here it is - command line editing commands in emacs style:
  cnoremap <C-A>      <Home>
  cnoremap <C-B>      <Left>
" cnoremap <C-B>      <Del>
  cnoremap <C-E>      <End>
  cnoremap <C-F>      <Right>
  cnoremap <C-N>      <End>
  cnoremap <C-P>      <Up>
  cnoremap <ESC>b     <S-Left>
  cnoremap <ESC><C-B> <S-Left>
  cnoremap <ESC>f     <S-Right>
  cnoremap <ESC><C-F> <S-Right>
  cnoremap <ESC><C-H> <C-W>
  cnoremap <ESC>[D <Left>
  cnoremap <ESC>[C <Right>

" ===================================================================
" VIM - Editing and updating the vimrc:
" As I often make changes to this file I use these commands
" to start editing it and also update it:
"  if has("unix")
"    let vimrc='~/.vimrc'
"  else
" ie:  if has("dos16") || has("dos32") || has("win32")
"    let vimrc='$VIM\_vimrc'
"  endif
"  nn  ,u :source <C-R>=vimrc<CR><CR>
"  nn  ,v :edit   <C-R>=vimrc<CR><CR>
"     ,v = vimrc editing (edit this file)
" map ,v :e ~/.vimrc<CR>
"     ,u = "update" by reading this file
" map ,u :source ~/.vimrc<CR>
" ===================================================================
"
" General Editing
"
" Define "del" char to be the same backspace (saves a LOT of trouble!)
"map <C-V>127 <C-H>
"cmap <C-V>127 <C-H>
" the same for Linux Debian which uses
"imap <Esc>[3~ <C-H>
"imap        <C-H>
"cmap        <C-H>
" remove whitespace from DOS emails
cmap ;rcm %s/<C-M>//g
"     Sws = show whitespace
nmap ,Sws :%s/ /_/g<C-M>
vmap ,Sws :%s/ /_/g<C-M>
"     Sometimes you just want to *see* that trailing whitespace:
"     Stws = show trailing whitespace
nmap ,Stws :%s/  *$/_/g<C-M>
vmap ,Stws :%s/  *$/_/g<C-M>

" ===================================================================
"     ,L  = "Last updated" - replace old time stamp with a new one
"        preserving whitespace and using internal "strftime" command:
"       requires the abbreviation  "YDATE"
  map ,L  1G/Last update:\s*/e+1<CR>CYDATE<ESC>
  map ,,L 1G/Last change:\s*/e+1<CR>CYDATE<ESC>
" Example:
" before:  "Last update:   Thu Apr  6 12:07:00 CET 1967"
" after:   "Last update:   Tue Dec 16 12:07:00 CET 1997"
"
"     ,L  = "Last updated" - replace old time stamp with a new one
"        using external "date" command (not good for all systems):
" map ,L 1G/Last update: */e+1<CR>D:r!date<CR>kJ
"
" ===================================================================
" General Editing - link to program "screen"
" ===================================================================
"
"       ,Et = edit temporary file of "screen" program
"  map   ,Et :e /tmp/screen-exchange
"       as a user of Unix systems you *must* have this program!
"       see also:  http://www.math.fu-berlin.de/~guckes/screen/
"
" Email/News - Editing replies/followups
"
" Part 1 - prepare for editing
"
" Part 2 - getting rid of empty (quoted) lines and space runs.
"
"      ,cel = "clear empty lines"
  map ,cel :%s/^\s\+$//
"      ,del = "delete 'empty' lines"
"       - delete all lines which contain only whitespace
"         note:  this does *not* delete empty lines!
  map ,del :g/^\s\+$/d
"
"      ,cqel = "clear quoted empty lines"
  nmap ,cqel :%s/^[>]\+$//
  vmap ,cqel  :s/^[><C-I> ]\+$//
" NOTE: If the meta sequence "\s" is defined
" The following do not work as "\s" is not a character
" and thus cannot be part of a "character set".
"  map ,cqel  :g/^[>\s]\+$/d
"
" Turning dot runs with following spaces into an end-of-sentence,
" ie dot-space-space:
  vmap ,dot :s/\.\+ \+/.  /g
" Gary Kline (kline at tera.tera.com) indents his
" own text in replies with TAB or spaces.
" Here's how to get rid of these indentation:
  vmap ,gary :s/^>[ <C-I>]\+\([^>]\)/> \1/
"      ,ksr = "kill space runs"
"             substitutes runs of two or more space to a single space:
  nmap ,ksr :%s/  \+/ /g
  vmap ,ksr  :s/  \+/ /g
"    ,Sel = "squeeze empty lines"
"    Convert blocks of empty lines (not even whitespace included)
"    into *one* empty line (within current visual):
   map ,Sel :g/^$/,/./-j
"    ,Sbl = "squeeze blank lines"
"    Convert all blocks of blank lines (containing whitespace only)
"    into *one* empty line (within current visual):
"  map ,Sbl :g/^\s*$/,/[^ <C-I>]/-j
"  map ,Sbl :g/^\s*$/,/[^ \t]/-j
   map ,Sbl :g/^\s*$/,/\S/-j
" Keyboard mapping for cursor keys
" [works for SUNs in Solarium (room 030) - 970815]
"
   map <ESC>OA <Up>
   map <ESC>OB <Down>
   map <ESC>OC <Right>
   map <ESC>OD <Left>
  imap <ESC>OA <Up>
  imap <ESC>OB <Down>
  imap <ESC>OC <Right>
  imap <ESC>OD <Left>
"
" Keyboard mapping for cursor keys
" [works for XTerminals - 970818]
   map <ESC>[A <Up>
   map <ESC>[B <Down>
   map <ESC>[C <Right>
   map <ESC>[D <Left>
  imap <ESC>[A <Up>
  imap <ESC>[B <Down>
  imap <ESC>[C <Right>
  imap <ESC>[D <Left>


if has("syntax")
    " The following sources the main syntax file,
    " ie. "$VIM/syntax/syntax.vim", see ":help :syn-on":
    if &t_Co > 1
       syntax on 
    endif
    " Redefine the color for "Comment":
    hi! Comment  term=bold  ctermfg=cyan  guifg=Blue
endif



More information about the LUG mailing list