23
1 Unix Text Editors How to write letters on a Unix system.

Unix Text Editors

  • Upload
    milo

  • View
    39

  • Download
    0

Embed Size (px)

DESCRIPTION

Unix Text Editors. How to write letters on a Unix system. Unix Text Editors. What is a text editor? Three popular ones exist here on miller pico emacs vi Going to give an overview of each. pico. Created at the University of Washington. Very popular program. - PowerPoint PPT Presentation

Citation preview

Page 1: Unix Text Editors

1

Unix Text Editors

How to write letters on a Unix system.

Page 2: Unix Text Editors

2

Unix Text Editors

What is a text editor? Three popular ones exist here on miller

pico emacs vi

Going to give an overview of each

Page 3: Unix Text Editors

3

pico

Created at the University of Washington. Very popular program. Easiest to use of all text editors.

Page 4: Unix Text Editors

4

Starting pico

pico [file name] [file name] can be an existing file. If [file name] does not exist, will be created. The pico window. Just type.

Page 5: Unix Text Editors

5

Pico Navigation

Use arrow keys, otherwise: Ctrl-f: move forward a character. Ctrl-b: move backward a character. Ctrl-n: move to the next line. Ctrl-p: move to the previous line. Ctrl-v: move forward one page. Ctrl-y: move backward one page.

Page 6: Unix Text Editors

6

Pico Editing

Inserting Just type.

Deleting Ctrl-k: deletes the current line of text. Note different

behavior from emacs. Ctrl-u: uncuts the last cut text. Similar to yank on

emacs.

Page 7: Unix Text Editors

7

Unique Pico stuff (?)

Automatic text wrapping (sort-of). Justify text. Inserting files (Read File).

Page 8: Unix Text Editors

8

Exiting Pico

To exit: Ctrl-x

May need to save your work.

Page 9: Unix Text Editors

9

emacs

Probably the most powerful. More than just a text editor. Could take whole classes on emacs.

Page 10: Unix Text Editors

10

Starting emacs

emacs [file name] [file name] can be an existing file. If [file name] does not exist, will be created. Just type.

Page 11: Unix Text Editors

11

emacs navigation

Use the arrow keys (if they exist), otherwise: Ctrl-f: forward one character Ctrl-b: backward one character Esc-f: forward one word Esc-b: backward one word Ctrl-n: next line Ctrl-p: previous line Ctrl-v: next screen Esc-v: previous screen

Page 12: Unix Text Editors

12

emacs editing

Inserting Just type.

Deleting [delete]: deletes backward. Ctrl-d: deletes forward. Esc-[delete]: deletes back one word. Esc-d: deletes forward one word.

Page 13: Unix Text Editors

13

emacs editing

Killing & yanking. Ctrl-k: kills from the cursor to the end of the line. Ctrl-y: yanks the text back out of memory.

Page 14: Unix Text Editors

14

Saving & Exiting emacs

To save your work Ctrl-x Ctrl-s (normal command) Ctrl-x Ctrl-\ (on the alphas)

To exit emacs Ctrl-x Ctrl-c Will prompt you to save if necessary.

Page 15: Unix Text Editors

15

vi text editor

Generally comes on all Unix systems. Probably the worst interface of all. Many hard-core Unix users love it.

Page 16: Unix Text Editors

16

vi text editor

Invoked the same way as emacs & pico: vi [file name] [file name] can be an existing file. If [file name] does not exist, will be created. The vi window

Note the ~ In command mode

Page 17: Unix Text Editors

17

vi modes

Command mode Get to command mode by pressing the esc key. Keystrokes execute commands

Input mode Get there by typing certain commands from command

mode. Keystrokes type letters on the screen

Last line mode Get there by typing a ‘:’ from the command mode. Begins with a : (colon) also used to issue commands

No way to tell what mode you are in.

Page 18: Unix Text Editors

18

Command mode

Navigation Use the arrow keys or: l or [space]: move forward one character. h or [backspace]: move back one character. j or [return]: move down one line. k or -: move up one line.

Page 19: Unix Text Editors

19

Input mode

Inserting text from command mode i: inserts text to the left of the cursor. a: inserts text to the right of the cursor. R: replaces the text as you type. o: inserts a blank line below the current line. O: inserts a blank line above the current line.

All of these commands put you into the input mode.

Page 20: Unix Text Editors

20

Command mode

Deleting text x: deletes one charcter. dd: deletes an entire line. Number modifier for both.

Page 21: Unix Text Editors

21

Line mode

Saving and exiting From command mode type a : (colon) Places you into the line mode. Then type the command to execute.

Page 22: Unix Text Editors

22

Line mode

:q quits the program - unless changes have been made.

:w writes (saves) the changes. :q! quits without saving changes. :wq writes the changes, and then quits.

Page 23: Unix Text Editors

23

Reading

Chapters 12 - 15. Unix email programs