Reset terminal after quitting VIM — colors all messed up

colorsterminalvim

Whenever I quit VIM my terminal colors are all messed up. Manually running reset on the command line doesn't seem to fix it either.

I'm using the Mustang VIM theme. I think I basically need to tell VIM to reset all colors or something before it quits.

Any ideas?

Best Answer

I was having a similar problem with Vim + GNU Screen + Terminal.app. Here was my solution:

Create a script called resetcolor:

#!/bin/bash

echo -ne "\033[0m"

Put this script in your PATH.

Then within ~/.vimrc, add the following:

au VimLeave * !resetcolor

Based on this answer.