Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

Have you ever noticed that the default vi key bindings on the Raspberry Pi are a little wacky? For example, while in insert mode, try using the arrow keys to navigate. Not happening :)

Is this a subtle way of getting us to use insert and command mode properly or maybe the bindings were just overlooked when the image was built?

I'm quite used to a certain key mapping in Fedora/Debian that allows the use of navigation keys while in insert mode. To get the familiar bindings I'm used to, do I need to fiddle with terminal emulation or some sort of configuration file somewhere?

share|improve this question
5  
I expect it's because you are used to vim and what you're now experiencing is truly vi. On modern distros, the vi command is often syslinked to vim. –  Jivings Dec 21 '12 at 18:18
    
Is this through ssh? You might need to even try stty sane and setting your TERM variable (export TERM=linux is usually easiest for me to remember) –  Drake Clarris Dec 21 '12 at 19:33
    
Which version? Latest (oct release) seems OK, at least over ssh. –  ergosys Dec 21 '12 at 22:30
add comment

2 Answers

up vote 6 down vote accepted

The default package is vim-tiny. You can install a version that is more familiar:

sudo apt-get install vim

Extra configuration and customization can be placed in the .vimrc file in your home directory.

share|improve this answer
    
Thanks buddy! Just when I thought there was no more hope, you saved the day :) –  Brad Hein Dec 22 '12 at 4:45
add comment

I also had this problem when I logged in as the root user but not the pi user. I have also installed vim with:

apt-get install vim

That didn't solve it alone but a little digging and I discovered that it was some environment variable differences. I managed to get my happy vi behavior of being able to move around with the cursor keys even in insert mode by simply changing the /root/.profile file to read as follows:

if [ -n "$BASH_VERSION" ]; then
  if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
  fi
fi

if [ -d "$HOME/bin" ] ; then
  PATH="$HOME/bin:$PATH"
fi
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.