Hi.

I've been using mutt and vim for about a year now and was missing something.
Namely I wanted to have xterm title to indicate a recipient of a message.
Finally I came up with a following function:

function M_settitle()
        let line_num = 1
        let line = getline(line_num)
        while (match(line, "To:") == -1)
                let line_num = line_num + 1
                let line = getline(line_num)
        endwhile
        let address = strpart(line, 4, strlen(line))
        let address = "Mail to " . address
        let address = substitute(address, " ", "\\\\ ", "g")
        execute 'set titlestring=' . address
endfunc

And in order for above to function you need to add the following to .vimrc:

        ...
        autocmd BufRead mutt*   exe M_settitle()
        ...

Regards,
Peter

Reply via email to