" Vim Mutt settings " Maintainer: Dmitry Borodaenko " Last Change: 9 Sep 2002 " Home: http://people.debian.org/~angdraug/ " When called from Mutt for email editing, scans for recepient (or newsgroup) " and subject fields, and sets xterm title to " / ". You " should enable edit_headers option in your muttrc for this trick to work. " " Additionally, it puts all quotation prefixes present in the file into the " list of nested comments strings, enabling autoformatting of quoted text. " " And finally, changes highlight colors to match Mutt color scheme from " /usr/share/doc/mutt/examples/colors.angdraug.gz in the mutt Debian package if has("autocmd") autocmd FileType mail execute M_settings() endif " set up xterm title to indicate a recipient of the letter function M_settings() " find a line with Subject: let i = search ("^Subject: ") if (i != 0) let &titlestring = strpart(getline(i), 9) . ' / ' endif " find a line with To: or Newsgroups: field let i = search ("^To: ") if (i == 0) let i = search ("^Newsgroups: ") endif " if it's there, modify title if (i != 0) let line = getline(i) let i = match(line, " ") + 1 let j = match(line, "<") - 1 if j == -2 let j = match(line, ",") endif if j == -1 let j = strlen(line) endif let &titlestring = &titlestring . strpart(line, i, j - i) let &iconstring = &titlestring else " leave default mutt title otherwise let &titlestring = "Mutt message" let &iconstring = "Mutt message" endif let &titleold='mutt' " detect all quote prefixes for autoformatting let &comments = "n:>" let line = search ("^ *[[:alpha:]]*>>* ", "W") while (line != 0) let s = getline(line) let n = strpart(s, match(s, "[^ ]", 0), match(s, " ", 1)) if (match(&comments, "n:".n."$") == -1) && (match(&comments, "n:".n.",") == -1) let &comments = &comments . ",n:" . n endif let line = search ("^ *[[:alpha:]]*>>* ", "W") endwhile " sync up with Mutt color scheme hi type ctermfg=green hi statement ctermfg=darkcyan hi comment ctermfg=darkcyan hi identifier ctermfg=darkgreen hi preproc ctermfg=blue hi special ctermfg=red hi string ctermfg=blue endfunc