Skip to content

Instantly share code, notes, and snippets.

@arenevier
arenevier / gist:2330049
Created April 7, 2012 16:15
mutt color schemes
color hdrdefault white default
color quoted magenta default
color signature red default
color indicator blue yellow
color error brightred default
color status black cyan
color tree green default # the thread tree in the index menu
color tilde magenta default
@arenevier
arenevier / mail.vim
Created August 12, 2011 14:12
autodetect email language to set correct spellang in vim
" strip email headers; otherwise, guess would be biased toward english
" put it in ~/.vim/ftplugin/mail.vim
function s:streapHeaders()
let l:headersend = 0
let l:result = []
for l:line in getline(1, '$')
if len(l:line) == 0
let l:headersend = 1
elseif l:headersend
@arenevier
arenevier / spelledit.sh
Created August 12, 2011 14:02 — forked from clochix/spelledit.sh
Detect spelllang when answering a message with mutt
# I usually get french and english emails, and would like to auto-detect the language
# to set the spellchecker when answering.
# (I use mutt and vim)
# In .muttrc:
set editor = 'bash ~/bin/spelledit.sh'
# and my ~/bin/spelledit.sh
vim + -c "setlocal spell spelllang=$([ `cat $1 | aspell -l en list | sort -u | wc -l` -lt `cat $1 | aspell -l fr list | sort -u | wc -l` ] && echo "en" || echo "fr") encoding=utf-8" $1
# Yes, this is dirty: I call aspell twice on the file,
# counting the number of bad words in french and english,
# and set spelllang to the lang with the less bad words