Skip to content
Frank Bauernöppel edited this page Jul 18, 2018 · 2 revisions

vi is a dinosaur, but, once tamed, a lovely one. vi is available on nearly all platforms. So its well worth giving it a try. There are many instructions, tutorials and cheat sheets on the internet. This one is intentionally kept minimal:

using vi

vi myfile
  • use the i command to switch from default mode to insert mode.
  • then, use the keyboard keys to navigate around, insert text or delete text using the backspace key while in insert mode.
  • use the ESC key to switch back from insert mode to default mode. Especially:
  • use the key sequence ESC : w q to exit vi with saving your changes ("write quit")
  • or use the key sequence ESC : q ! to exit vi without saving your changes ("quit!")

copy & paste

use X11 style copy (left mouse button drag) and paste (middle mouse button click) to copy larger portions of text between the target board and the Ubuntu build host. Then, you can keep using your favorite editor on the build host.

arrow keys produce strange results

If you get unexpected output (letters A B C D) when pressing an arrow key, enter ESC : set term=ansi. You can make this change permanent by adding a line in ~/.vimrc file.

vi reference card

http://wissrech.ins.uni-bonn.de/teaching/prama1_ws05/vi-ref.pdf