Vi Arrow Keys in Ubuntu Edgy
Ever since upgrading to Ubuntu Edgy back around the late beta days I’ve had to ditch vi as my usual console editor of choice due to the arrow keys outputting characters such as “A” “B” “C” or “D” on a newline with each key-press. Well, no more! I’ve found a remarkably simple fix…
sudo aptitude install vim-full
As well as vi now supporting the “xterm” term type that fixes the arrow keys problem, it is also now possible to add indenting and syntax highlighting for many filetypes. To do this add the following to your .vimrc file (located in your user directory, create it if it doesn’t already exist)...
filetype plugin on filetype indent on syntax on
The reason for vi misbehaving in the first place is due to Ubuntu installing vim-tiny as default – although this package is much smaller it does lack a lot of features such as those mentioned above. This fix was so easy I’m now annoyed at myself that I didn’t try to find a solution sooner!
Note: You can also use apt-get in place of aptitude if you prefer