Good Old VI


We can't help it... it's in our blood. Like riding a bike... takes a few seconds but it comes back... within a few minutes your living on the control keys! Old programmers don't die... they just break into bits.

Anyone that has been in the software industry... especially on a linux/unix platform has dealt with vi. Seems kind of archaic these days but back in the day... you could get a feel for a programmers experience level with... How's your VI? The response is always a dead give away.

In the MSDOS world it was edlin. Same, same. Now we have EMACS, NANO, and a host of others comming on the seen. But back in the day it ws VI. In any event... if you ever find yourself without a GUI, doing a quick and dirty, this cheat sheet will help.

CREATED 2012-11-29 02:20:08.0

00-18-76

UPDATED 2012-11-29 02:20:08.0

Files... Files... Files...


vi [filename] vi -r [filename]

VI is a file editor. What ever type of file it is vi can open it. However, vi is for editing text files... so if it isn't a text file the result may not be pretty. By the way....vi IS case sensitive. To open a file use this syntax:

if you need to recover a file that you were editing when the system crashed... OR

To save a file: First, when using vi there are different modes. Insert mode and manipulation mode. If the editor is in the insert mode, get out of it with the <Esc> key, that will return the editor back to the manipulation mode. These keys will get you out of the editor depending on what you want to do. First, enter a colon. Shift + : then use these keys...

  • q - exit... prompt if the file is modified but not saved.
  • w! - exit without saving... no prompt.
  • wq - will save the file and exit... no prompt.
  • x - same as wq

CREATED 2012-11-29 02:39:52.0

00-18-77

UPDATED 2012-11-29 02:40:03.0

Cutting and Pasting...


2Y Yw Y$

To cut text fom a line use the Y or Yank command. To cut a number of lines indicate the number of lines before the Y as in...

yanks or copies 2 lines of text. To copy inside a line use...

...to copy the next word and...

to copy to the end of the line.

To paste the Yanked text use P or p. Uppercase P copies text above or before the current position while lowercase copies after or below.

CREATED 2012-12-04 04:36:44.0

00-18-AE

UPDATED 2012-12-04 04:36:52.0

Getting Around...


One Char One Word One Sentence
  • h - Left
  • j - Down
  • k - Up
  • l - Right
  • w - next word
  • W - next blank delimited word
  • b - begining of word
  • B - begining of blank del word
  • e - end of word
  • E - end of blank del word

CREATED 2012-12-07 06:00:38.0

00-18-B0

UPDATED 2012-12-07 06:01:01.0

DBID: db.wam

Page Server: Ithica

©2012 Leistware Data Systems

      Hello anonymous