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
1
Unix Text Editors
How to write letters on a Unix system.
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
3
pico
Created at the University of Washington. Very popular program. Easiest to use of all 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.
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.
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.
7
Unique Pico stuff (?)
Automatic text wrapping (sort-of). Justify text. Inserting files (Read File).
8
Exiting Pico
To exit: Ctrl-x
May need to save your work.
9
emacs
Probably the most powerful. More than just a text editor. Could take whole classes on emacs.
10
Starting emacs
emacs [file name] [file name] can be an existing file. If [file name] does not exist, will be created. Just type.
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
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.
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.
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.
15
vi text editor
Generally comes on all Unix systems. Probably the worst interface of all. Many hard-core Unix users love it.
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
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.
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.
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.
20
Command mode
Deleting text x: deletes one charcter. dd: deletes an entire line. Number modifier for both.
21
Line mode
Saving and exiting From command mode type a : (colon) Places you into the line mode. Then type the command to execute.
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.
23
Reading
Chapters 12 - 15. Unix email programs