public
Created

vim-pathogen with mutt and git

  • Download Gist
gistfile1.md
Markdown

This was originally posted on 2011-04-05 to http://andrewho.co.uk/weblog/vim-pathogen-with-mutt-and-git

For a long time I've used vim as my editor for both composing messages in mutt and commit messages for git. I do this with the following line in my ~/.muttrc (and a similar one in my ~/.gitconfig:

set editor = "vim -c 'set wrap tw=76 fo=toqwal12 nonumber spell' +1"

Recently I refactored my vim configuration files using Tim Pope's excellent pathogen script. Doing so required me to place the following lines in my ~/.vimrc to load all plugins from ~/.vim/bundle:

call pathogen#runtime_append_all_bundles()
call pathogen#helptags()

However, on debian filetype detection is turned on by default which causes problems with pathogen. The fix is to turn it off before calling pathogen:

filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
filetype plugin indent on

This produces another problem, however. For some unknown reason, filetype off causes vim to exit with a non-zero exit code on Mac OS X. When used with mutt, this throws up an ugly warning after editing a message. Git flat out refuses to acknowledge a commit message in this case. The solution is to turn it on then off again:

filetype on
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
filetype plugin indent on

This vim configuration will work on both debian-based and Mac OS X systems.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.