Vim is not Vi.. compatability mode threw me

Noticed a bunch of little things running vi on Debian that, although both vi and vim point to /etc/alternatives/vim.tiny, made me suspect that there was somehow a difference.. vi was operating differently to vim (or should I say vim was operating differently to vi)

Turns out running 'vi' by default starts vim in 'vi compatability mode' which causes some things to be different (arrow keys in edit mode do entirely different things than expected :) )

Thought I was going crazy til I noticed 'compatability mode' mentioned in the vim startup message.. bit of googling led me to Wikipedia to understand what was going on

Vim also has a vi compatibility mode, controlled by the :set compatible option. This mode is automatically turned on by Vim when it is started in a situation which looks as if the software might be expected to be vi compatible. Vim then changes some of its behaviors such that they are compatible with the vi standard.

Looks like I'm not the first to be tripped up by this, though I don't disagree with it once I understood the logic.

Add new comment