How do I replace vi by vim so that when I type vi in terminal vim is opened?


'vi' in Ubuntu already starts 'vim', although by default it starts 'vim-tiny' (which comes closest to the original 'vi' in its (lack of) features). You can see this with:

sudo update-alternatives --display vi

If you want it to use another version of vim, then make sure it's installed and run:

sudo update-alternatives --config vi

You can add

alias vi=vim

to ~/.bashrc . This will start vim whenever you type vi.

Note that in Ubuntu 10.10 (and I think also 10.04) vi is already mapped to vim.