Editing text files

Why we need text editors

An example of early typesetting

An example of early word processing and typesetting is the roff command. It is a descendant of the RUNOFF program that ran on CTSS, an operating system for IBM mainframes in the 1960s. It became the basis for runoff, the word processor Douglas McIlroy and Robert Morris wrote for the Multics project. Ken Thompson and Dennis Ritchie ported it to Unix and shortened its name to roff. Its later evolutionary stages became nroff (“new roff”), troff (“typesetting roff”) and groff (“GNU roff”).

roff printed the man pages for Unix versions 1 through 3. When in late 1970, the patent department at Bell Labs was looking for a better document-formatting system, the Unix team offered that it would provide and maintain an in-house solution based on roff. In return, the patent department was to procure one of the first PDP-11/45 and share it with the Unix team.

  • nroff (Unix, 1970s)
  • troff (Unix, 1970s)
  • groff (GNU, 1980s)

Vim

  • ed (Ken Thompson, 1971)
  • ex (Bill Joy, 1976)
  • vi (Bill Joy, 1979)
  • Stevie (Tim Thompson, 1987)
  • vim (Bram Moolenaar, 1991)
  • neovim (Thiago de Arruda, 2014)

Other editors

Emacs

gedit

Leafpad

Kate

xfw

xed

Learning vim

Modes

  • Normal mode
  • Insert mode
  • Visual mode
  • Command-line mode

Motions

  • h, j, k, l
  • w, b, e
  • 0, ^, $
  • gg, G
  • f, t, F, T
  • Multiple motions

Editing

  • i, a, I, A
  • o, O
  • d, c, y, p
  • u, Ctrl-r
  • .

Editing motions

  • d$
  • d2w
  • diw
  • dt.

vimtutor

Experiment 10-2

Disabling SELinux

Use your favourite text editor

Summary