TEXT EDITORS
===============================================================================
EMACS
To edit a new or existing file, type at the shell prompt
emacs FILENAME
To open file in emacs with cursor at line 132, type
emacs +132 FILENAME
------------------------------------------------------------------------------- F1, F2 ... represent function keys C-<chr> means: hold the CONTROL key while typing the character <chr> Thus, C-f would be: hold the CONTROL key and type f. M-<chr> means: press the Escape (ESC) key, release it, then type the character <chr>. If no key is labeled ESC, try F11 or F12. ------------------------------------------------------------------------------- Commands for Quitting and Saving C-x s Save what you are working on C-x C-w Write to a file -- will prompt for name (like "save as" on pc's) C-x C-c Quit Emacs. Commands for moving around and general editing Right arrow key Move forward a character Left arrow key Move backward a character Down arrow key Move to next line Up arrow key Move to previous line C-v (or Page Down key) Move forward one screenful M-v (or key to left of Page down key) Move backward one screenful C-a Move to beginning of line C-e Move to end of line M-< Go to beginning of file M-> Go to end of file Cutting and pasting C-k kill from the cursor position to end of line C-y yank (paste) text just deleted C-x u Undo C-@ Set mark (note; press Ctrl-Shift-@ together) C-w Kill between cursor (point) and mark
Searching and replacing C-s Search forward for string C-r Search backward for string M-x replace-string Global replace M-x query-replace Conditional replace For writing Ada programs F2 Global replace string F6 Check program for correct syntax (or use C-c C-v) F7 Compile and link program and create executable (or use C-c C-c) F8 Go to line (will be prompted for line number) F9 Compile and link program (redundant for this course) F10 Go to next error message (if used after F6 or F7) F11 Emacs help key on PCs F12 is Meta key on some PCs Other useful commands C-h Help C-g Abort command (usually one started accidentally) C-L Clear screen and redisplay everything C-q Unfreeze the terminal window C-x 1 One window (kill all windows except the one containing the cursor). C-x o Go to other window C-x i Insert the contents of a file at the cursor
===============================================================================
PICO
Pico is a simple, user friendly text editor. It does not have the multitude of features present in emacs, but unlike emacs it is fully self-explanatory. An information line at the bottom of the screen always tells the user what options and commands are currently available.
To edit a new or existing file, type at the shell prompt
pico FILENAME
To open file in pico with cursor at line 132, type
pico +132 FILENAME
===============================================================================