I'm on Mac OS X, but I guess this is the same for other unixes.
Every time I type
vi on the terminal, I want to open the GUI version of Vim (in Mac OS it's called
For my user, I got it working adding an alias on my ~/.profile:
But when I have to
sudo vi, it opens the terminal's vi, because it doesn't have the alias set.
I tried setting the alias for the root user on
/etc/profile but it did not work. I also tried making
/usr/bin/vi a symbolic link to
mvim, but it didn't work either.
How can I make it so evey time any user, including root, types
vi on the Terminal, it opens the windowed Vim?