Multimedia Design

Vi – cheat sheet

the vi editor
Vi with line numbers, dark background and colored syntax in a markup environment.

Vi is a very powerfull editor, that is … for the initiated. Here are some of my favorite vi commands:

Colors, syntax, write, quit

  • :syn on – colored syntax
  • :syn off – no colored syntax
  • :set number – line numbers
  • :set background=dark – better color contrast in a dark terminal window
  • :q! – quit without saving
  • :w – save
  • :wq – save and quit

Copy / Paste

First mark some text. Move the cursor to the beginning of whatever should be copied. Then press v. Now you can mark something. Press Y to yank or d to delete (= cut). Move the cursor to where you want to put the clipping or copy. Then press p.

Save Your Favorite Settings

You may want to save your favorite settings. Vi use the file .vimrc – my .vimrc looks like this:

set number
set background=dark
syn on
set autoindent
set shiftwidth=4

By Per Thykjaer Jensen

Per is the WordPress expert at Business Academy Aarhus. Senior Lecturer at the Multimedia Design Programme. His background is in the Arts: MA Literature History and BA Art History. Later he added a MA in IT, interaction and Multimedia. And he is a wicked Linux user.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

We use cookies - is it ok with you+ more information will set a few cookies from Doubleclick, Google and the Social Media plugins they ay set some cookies.